Skip to content

Commit 9d6abbf

Browse files
authored
chore: cleanup dependencies with built-in replacements (#23)
1 parent 7079630 commit 9d6abbf

24 files changed

+814
-1187
lines changed

.changeset/brown-walls-float.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-jsx-a11y-x": patch
3+
---
4+
5+
chore: cleanup dependencies with built-in replacements

.env.yarn

Whitespace-only changes.

CHANGELOG.md

Lines changed: 2 additions & 724 deletions
Large diffs are not rendered by default.

CHANGELOG_LEGACY.md

Lines changed: 725 additions & 0 deletions
Large diffs are not rendered by default.

__mocks__/JSXAttributeMock.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @flow */
22

3-
import toAST from 'to-ast'; // eslint-disable-line import-x/no-extraneous-dependencies
3+
import toAST from 'to-ast';
44
import JSXExpressionContainerMock from './JSXExpressionContainerMock';
55

66
export type JSXAttributeMockType = {

__mocks__/genInteractives.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/** @flow */
22

33
import { dom, roles } from 'aria-query';
4-
import fromEntries from 'object.fromentries';
54

65
import JSXAttributeMock from './JSXAttributeMock';
76
import JSXElementMock from './JSXElementMock';
@@ -120,7 +119,7 @@ const nonInteractiveElementsMap: { [string]: Array<{ [string]: string }> } = {
120119
};
121120

122121
const indeterminantInteractiveElementsMap: { [key: string]: Array<any> } =
123-
fromEntries(domElements.map(name => [name, []]));
122+
Object.fromEntries(domElements.map(name => [name, []]));
124123

125124
Object.keys(interactiveElementsMap)
126125
.concat(Object.keys(nonInteractiveElementsMap))

__tests__/__util__/axeMapping.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-underscore-dangle */
21
import * as axe from 'axe-core';
32

43
export function axeFailMessage(checkId, data) {

__tests__/__util__/helpers/getESLintCoreRule.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import semver from 'semver';
33

44
const isESLintV8 = semver.major(version) >= 8;
55

6-
// eslint-disable-next-line global-require, import-x/no-dynamic-require, import-x/no-unresolved
76
const getESLintCoreRule = ruleId =>
87
isESLintV8
98
? require('eslint/use-at-your-own-risk').builtinRules.get(ruleId)

__tests__/__util__/helpers/parsers.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import path from 'path';
22
import semver from 'semver';
3-
import entries from 'object.entries';
43
import { version } from 'eslint/package.json';
54

65
let tsParserVersion;
76
try {
8-
// eslint-disable-next-line import-x/no-unresolved, global-require
97
tsParserVersion = require('@typescript-eslint/parser/package.json').version;
108
} catch {
119
//
@@ -25,7 +23,7 @@ function minEcmaVersion(features, parserOptions) {
2523
...[]
2624
.concat(
2725
(parserOptions && parserOptions.ecmaVersion) || [],
28-
entries(minEcmaVersionForFeatures).flatMap(entry => {
26+
Object.entries(minEcmaVersionForFeatures).flatMap(entry => {
2927
const f = entry[0];
3028
const y = entry[1];
3129
return features.has(f) ? y : [];

__tests__/__util__/ruleOptionsMapperFactory.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
/** @flow */
22

3-
import entries from 'object.entries';
4-
import fromEntries from 'object.fromentries';
5-
63
type ESLintTestRunnerTestCase = {
74
code: string,
85
errors: ?Array<{ message: string, type: string }>,
@@ -18,7 +15,6 @@ type RuleOptionsMapperFactoryType = (
1815
export default function ruleOptionsMapperFactory(
1916
ruleOptions: Array<mixed> = [],
2017
): RuleOptionsMapperFactoryType {
21-
// eslint-disable-next-line
2218
return ({
2319
code,
2420
errors,
@@ -31,8 +27,10 @@ export default function ruleOptionsMapperFactory(
3127
errors,
3228
// Flatten the array of objects in an array of one object.
3329
options: [
34-
fromEntries(
35-
(options || []).concat(ruleOptions).flatMap(item => entries(item)),
30+
Object.fromEntries(
31+
(options || [])
32+
.concat(ruleOptions)
33+
.flatMap(item => Object.entries(item)),
3634
),
3735
],
3836
parserOptions,

0 commit comments

Comments
 (0)