Skip to content

Commit

Permalink
fix: add base config with globals browser, add react detect settings
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewPattell committed Feb 29, 2024
1 parent d9cadd7 commit 30f1ff6
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 11 deletions.
9 changes: 9 additions & 0 deletions configs/base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import globals from 'globals';

export default {
languageOptions: {
globals: {
...globals.browser,
}
}
}
5 changes: 5 additions & 0 deletions configs/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ export default {
plugins: {
react: pluginReact,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'react/no-deprecated': ['warn'],
'react/no-did-mount-set-state': ['warn'],
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import baseConfig from '@lomray/eslint-config';
import react from './configs/react.js';
import reactHooks from './configs/react-hooks.js';
import jsx from './configs/jsx-a11y.js';
import base from './configs/base.js';

const reactConfig = [
base,
react,
reactHooks,
jsx,
Expand All @@ -12,7 +14,7 @@ const reactConfig = [
const recommended = [
...baseConfig.recommended,
...reactConfig,
]
];

export default {
recommended,
Expand Down
43 changes: 35 additions & 8 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lomray/eslint-config-react",
"version": "5.0.4",
"version": "5.0.5",
"description": "This package provides Lomray eslint config as an extensible shared config for React.",
"main": "index.js",
"type": "module",
Expand Down Expand Up @@ -28,6 +28,7 @@
"@lomray/eslint-config": "^5.0.3",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0"
"eslint-plugin-react-hooks": "^4.6.0",
"globals": "^14.0.0"
}
}

0 comments on commit 30f1ff6

Please sign in to comment.