Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
chore: simplify ESLint config (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
rot1024 committed Jul 26, 2022
1 parent 572da09 commit b3570ab
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 161 deletions.
91 changes: 2 additions & 89 deletions .eslintrc.yml
@@ -1,21 +1,7 @@
env:
es6: true
node: true
extends:
- eslint:recommended
- plugin:prettier/recommended
- plugin:import/recommended
- plugin:import/typescript
- plugin:import/warnings
parserOptions:
ecmaVersion: 2020
plugins:
- prettier
- reearth
root: true
rules:
import/first: warn
import/newline-after-import: warn
import/no-named-as-default: 'off'
import/order:
- warn
- pathGroups:
Expand All @@ -27,76 +13,7 @@ rules:
alphabetize:
order: asc
caseInsensitive: true
prettier/prettier: warn
overrides:
- files:
- '*.ts'
- '*.tsx'
parser: '@typescript-eslint/parser'
parserOptions:
sourceType: module
env:
browser: true
commonjs: true
node: false
plugins:
- react
- react-hooks
- '@typescript-eslint'
extends:
- plugin:react/recommended
- plugin:react/jsx-runtime
- plugin:@typescript-eslint/recommended
rules:
'@typescript-eslint/explicit-function-return-type': 'off'
'@typescript-eslint/explicit-module-boundary-types': 'off'
'@typescript-eslint/interface-name-prefix': 'off'
'@typescript-eslint/no-empty-function': 'off'
'@typescript-eslint/no-explicit-any': 'off'
'@typescript-eslint/no-unused-vars':
- 'error'
- argsIgnorePattern: '^_'
varsIgnorePattern: '^_'
'@typescript-eslint/no-use-before-define': 'off'
'@typescript-eslint/prefer-optional-chain': warn
'@typescript-eslint/ban-types': [
'error',
{
'extendDefaults': true,
'types': {
'{}': false
}
}
]
import/no-unresolved: 'off'
no-undef: 'off'
react/prop-types: 'off'
react-hooks/rules-of-hooks: error
react-hooks/exhaustive-deps: warn
settings:
react:
version: detect
- files:
- '*.test.ts'
plugins:
- testing-library
extends:
- plugin:testing-library/dom
- files:
- '*.test.tsx'
plugins:
- testing-library
extends:
- plugin:testing-library/react
- files:
- '*.js'
extends:
- plugin:node/recommended
plugins:
- node
rules:
node/no-unpublished-require: 'off'
node/no-unpublished-import: 'off'
- files:
- src/gql/queries/*.ts
- src/gql/fragments/*.ts
Expand All @@ -114,7 +31,6 @@ overrides:
- env: apollo
requiredFields:
- id
# TODO: I want to apply Prettier to GraphQL documents
- files:
- src/**/*.graphql
plugins:
Expand All @@ -136,9 +52,6 @@ overrides:
- id
- files:
- cypress/**/*
parserOptions:
sourceType: module
extends:
- reearth/node
- plugin:cypress/recommended
rules:
node/no-unsupported-features/es-syntax: [error, { ignores: [modules] }]
10 changes: 1 addition & 9 deletions package.json
Expand Up @@ -103,8 +103,6 @@
"@types/styled-components": "^5.1.25",
"@types/webpack": "^5.28.0",
"@types/webpack-env": "^1.17.0",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"@welldone-software/why-did-you-render": "^7.0.1",
"babel-jest": "^27.5.1",
"babel-loader": "^8.2.5",
Expand All @@ -117,15 +115,9 @@
"del-cli": "^4.0.1",
"dotenv": "^16.0.1",
"eslint": "^8.16.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-reearth": "^0.1.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-graphql": "^4.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-react-hooks": "^4.5.0",
"eslint-plugin-testing-library": "^5.5.1",
"file-loader": "^6.1.0",
"hard-source-webpack-plugin": "^0.13.1",
"html-webpack-plugin": "^5.4.0",
Expand Down

0 comments on commit b3570ab

Please sign in to comment.