Skip to content

Commit 1d12289

Browse files
committed
migrate config
1 parent 1bbcd49 commit 1d12289

File tree

7 files changed

+89
-52
lines changed

7 files changed

+89
-52
lines changed

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 48 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import globals from 'globals';
2+
import babelParser from '@babel/eslint-parser';
3+
import js from '@eslint/js';
4+
import reactPlugin from 'eslint-plugin-react';
5+
import importPlugin from 'eslint-plugin-import';
6+
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
7+
import prettierRecommended from 'eslint-plugin-prettier/recommended';
8+
9+
export default [
10+
js.configs.recommended,
11+
reactPlugin.configs.flat.recommended,
12+
importPlugin.flatConfigs.recommended,
13+
importPlugin.flatConfigs.react,
14+
jsxA11yPlugin.flatConfigs.recommended,
15+
prettierRecommended,
16+
{
17+
ignores: ['webpack.*', '**/lib', '**/dist', '**/esm'],
18+
},
19+
{
20+
languageOptions: {
21+
globals: {
22+
...globals.browser,
23+
...globals.node,
24+
},
25+
26+
parser: babelParser,
27+
28+
parserOptions: {
29+
requireConfigFile: false,
30+
},
31+
},
32+
33+
settings: {
34+
react: {
35+
version: 'detect',
36+
},
37+
},
38+
39+
rules: {
40+
'jsx-a11y/no-static-element-interactions': 'off',
41+
42+
'import/no-extraneous-dependencies': [
43+
'error',
44+
{
45+
devDependencies: [
46+
'**/__tests__/**/*',
47+
'examples/src/**/*.js',
48+
'rollup.config.js',
49+
'webpack.config.js',
50+
],
51+
52+
optionalDependencies: false,
53+
},
54+
],
55+
56+
'no-unused-vars': [
57+
'error',
58+
{
59+
ignoreRestSiblings: true,
60+
},
61+
],
62+
63+
'no-console': 'error',
64+
'react/prop-types': 'off',
65+
},
66+
},
67+
{
68+
files: ['**/*-test.js'],
69+
70+
languageOptions: {
71+
globals: {
72+
...globals.jest,
73+
},
74+
},
75+
},
76+
];

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"eslint-plugin-jsx-a11y": "6.10.2",
7070
"eslint-plugin-prettier": "5.2.1",
7171
"eslint-plugin-react": "7.37.2",
72+
"globals": "15.13.0",
7273
"hoist-non-react-statics": "3.3.2",
7374
"html-loader": "5.1.0",
7475
"html-webpack-plugin": "5.6.3",

pnpm-lock.yaml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/UncontrolledTabs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function determineCanUseActiveElement(environment) {
3232
env.document &&
3333
env.document.activeElement
3434
);
35+
// eslint-disable-next-line no-unused-vars
3536
} catch (e) {
3637
// Work around for IE bug when accessing document.activeElement in an iframe
3738
// Refer to the following resources:

src/components/__tests__/Tabs-test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,11 @@ describe('<Tabs />', () => {
351351
<Tabs>
352352
<TabList>
353353
<Tab>Tab A</Tab>
354+
{/* eslint-disable-next-line no-constant-binary-expression*/}
354355
{false && <Tab>Tab B</Tab>}
355356
</TabList>
356357
<TabPanel>Content A</TabPanel>
358+
{/* eslint-disable-next-line no-constant-binary-expression*/}
357359
{false && <TabPanel>Content B</TabPanel>}
358360
</Tabs>,
359361
);

0 commit comments

Comments
 (0)