Skip to content

Commit

Permalink
chore: 🤖 explode eslint configs
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy-guzman committed Oct 25, 2023
1 parent 7925b16 commit 558d5c9
Show file tree
Hide file tree
Showing 9 changed files with 263 additions and 164 deletions.
69 changes: 53 additions & 16 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,23 +1,45 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'jimmy-guzman',
'jimmy-guzman/typescript',
'jimmy-guzman/react',
'jimmy-guzman/vitest',
'jimmy-guzman/testing-library',
'eslint:recommended',
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:jsx-a11y/recommended',
'plugin:react-hooks/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'prettier',
],
parserOptions: {
project: ['./tsconfig.json', './tsconfig.node.json'],
},
rules: {
// https://vitejs.dev/guide/assets.html#the-public-directory
'import/no-absolute-path': 'off',
'import/no-unresolved': ['error', { ignore: ['\\.svg$'] }],
'import/no-anonymous-default-export': 'off',

'@typescript-eslint/explicit-module-boundary-types': 'off',
},
overrides: [
{
env: {
node: true,
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script',
},
},
{
extends: ['plugin:@typescript-eslint/disable-type-checked'],
files: ['./**/*.{js,cjs}'],
},
{
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
plugins: ['jest'],
extends: [
'plugin:testing-library/react',
'plugin:jest/recommended',
'plugin:jest/style',
'plugin:jest-dom/recommended',
],
rules: { 'jest/no-deprecated-functions': 'off' },
},
{
files: ['**/e2e/**/*.[jt]s?(x)'],
rules: {
Expand All @@ -27,4 +49,19 @@ module.exports = {
},
},
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
},
plugins: ['@typescript-eslint', 'react'],
rules: {},
settings: {
'react': { version: 'detect' },
'import/resolver': {
typescript: true,
node: true,
},
},
}
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,22 @@
"@testing-library/user-event": "14.4.3",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"@typescript-eslint/eslint-plugin": "6.9.0",
"@typescript-eslint/parser": "6.9.0",
"@vitejs/plugin-react-swc": "3.3.2",
"@vitest/coverage-v8": "0.34.2",
"autoprefixer": "10.4.15",
"daisyui": "3.6.1",
"eslint": "8.47.0",
"eslint-config-jimmy-guzman": "10.0.0",
"eslint-config-prettier": "9.0.0",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-jest": "27.4.3",
"eslint-plugin-jest-dom": "5.1.0",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-testing-library": "6.1.0",
"gitzy": "4.0.0",
"jsdom": "22.1.0",
"postcss": "8.4.28",
Expand Down
Loading

0 comments on commit 558d5c9

Please sign in to comment.