Skip to content

Commit

Permalink
migrate to eslint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
ayan4m1 committed Sep 22, 2024
1 parent 57007f3 commit c674fbb
Show file tree
Hide file tree
Showing 4 changed files with 236 additions and 54 deletions.
37 changes: 0 additions & 37 deletions .eslintrc.cjs

This file was deleted.

59 changes: 59 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import js from '@eslint/js';
import globals from 'globals';
import reactPlugin from 'eslint-plugin-react';
import babelParser from '@babel/eslint-parser';
import prettierPlugin from 'eslint-plugin-prettier/recommended';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import importPlugin from 'eslint-plugin-import-x';

export default [
js.configs.recommended,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.react,
{
plugins: {
react: reactPlugin,
'react-hooks': reactHooksPlugin
},
languageOptions: {
globals: globals.browser,
parser: babelParser,
parserOptions: {
requireConfigFile: false,
babelOptions: {
presets: [
[
'babel-preset-gatsby',
{
reactRuntime: 'automatic'
}
]
]
}
}
},
rules: {
...reactPlugin.configs.recommended.rules,
...reactHooksPlugin.configs.recommended.rules,
'react/jsx-uses-react': 0,
'react/react-in-jsx-scope': 0
},
settings: {
react: {
version: 'detect'
},
'import-x/resolver': {
node: {
paths: ['./src/']
}
}
}
},
{
files: ['gatsby-*.js'],
languageOptions: {
globals: globals.node
}
},
prettierPlugin
];
186 changes: 172 additions & 14 deletions package-lock.json

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

Loading

0 comments on commit c674fbb

Please sign in to comment.