Skip to content

Commit

Permalink
migrate config
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Dec 18, 2024
1 parent 1bbcd49 commit c6a3a9e
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 52 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

48 changes: 0 additions & 48 deletions .eslintrc

This file was deleted.

76 changes: 76 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import globals from 'globals';
import babelParser from '@babel/eslint-parser';
import js from '@eslint/js';
import reactPlugin from 'eslint-plugin-react';
import importPlugin from 'eslint-plugin-import';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import prettierRecommended from 'eslint-plugin-prettier/recommended';

export default [
js.configs.recommended,
reactPlugin.configs.flat.recommended,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.react,
jsxA11yPlugin.flatConfigs.recommended,
prettierRecommended,
{
ignores: ['webpack.*', '**/lib', '**/dist', '**/esm'],
},
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},

parser: babelParser,

parserOptions: {
requireConfigFile: false,
},
},

settings: {
react: {
version: 'detect',
},
},

rules: {
'jsx-a11y/no-static-element-interactions': 'off',

'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'**/__tests__/**/*',
'examples/src/**/*.js',
'rollup.config.js',
'webpack.config.js',
],

optionalDependencies: false,
},
],

'no-unused-vars': [
'error',
{
ignoreRestSiblings: true,
},
],

'no-console': 'error',
'react/prop-types': 'off',
},
},
{
files: ['**/*-test.js'],

languageOptions: {
globals: {
...globals.jest,
},
},
},
];
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"eslint-plugin-jsx-a11y": "6.10.2",
"eslint-plugin-prettier": "5.2.1",
"eslint-plugin-react": "7.37.2",
"globals": "15.13.0",
"hoist-non-react-statics": "3.3.2",
"html-loader": "5.1.0",
"html-webpack-plugin": "5.6.3",
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/components/UncontrolledTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function determineCanUseActiveElement(environment) {
env.document &&
env.document.activeElement
);
// eslint-disable-next-line no-unused-vars
} catch (e) {
// Work around for IE bug when accessing document.activeElement in an iframe
// Refer to the following resources:
Expand Down
2 changes: 2 additions & 0 deletions src/components/__tests__/Tabs-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,11 @@ describe('<Tabs />', () => {
<Tabs>
<TabList>
<Tab>Tab A</Tab>
{/* eslint-disable-next-line no-constant-binary-expression*/}
{false && <Tab>Tab B</Tab>}
</TabList>
<TabPanel>Content A</TabPanel>
{/* eslint-disable-next-line no-constant-binary-expression*/}
{false && <TabPanel>Content B</TabPanel>}
</Tabs>,
);
Expand Down

0 comments on commit c6a3a9e

Please sign in to comment.