Skip to content

Commit

Permalink
chore: Update eslint config from alpha branch (#5632)
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins authored Jun 27, 2023
1 parent d0388a9 commit ddf6986
Show file tree
Hide file tree
Showing 33 changed files with 960 additions and 939 deletions.
32 changes: 19 additions & 13 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,59 @@ const config = {
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
'react-app',
'prettier',
],
env: {
es6: true,
browser: true,
es2020: true,
},
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.base.json',
sourceType: 'module',
ecmaVersion: 2020,
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
node: true,
typescript: {
project: 'packages/*/tsconfig.json',
},
typescript: true,
},
react: {
version: 'detect',
},
},
rules: {
'react/jsx-key': ['error', { checkFragmentShorthand: true }],
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports' },
],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-inferrable-types': [
'error',
{
ignoreParameters: true,
},
{ ignoreParameters: true },
],
'no-shadow': 'error',
'import/no-cycle': 'error',
'import/no-unresolved': ['error', { ignore: ['^@tanstack/'] }],
'import/no-unused-modules': ['off', { unusedExports: true }],
'no-redeclare': 'off',
'react-hooks/exhaustive-deps': 'error',
'no-shadow': 'error',
},
overrides: [
{
files: ['**/*.test.{ts,tsx}'],
rules: {
'@typescript-eslint/no-unnecessary-condition': 'off',
},
},
],
}

module.exports = config
10 changes: 5 additions & 5 deletions examples/react/algolia/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": ["react-app", "prettier", "plugin:@tanstack/eslint-plugin-query/recommended"],
"rules": {
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off"
}
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:@tanstack/eslint-plugin-query/recommended"
]
}
9 changes: 4 additions & 5 deletions examples/react/basic-graphql-request/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": ["react-app", "prettier"],
"rules": {
// "eqeqeq": 0,
// "jsx-a11y/anchor-is-valid": 0
}
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended"
]
}
6 changes: 5 additions & 1 deletion examples/react/basic-typescript/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"extends": ["react-app", "prettier", "plugin:@tanstack/eslint-plugin-query/recommended"]
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:@tanstack/eslint-plugin-query/recommended"
]
}
4 changes: 2 additions & 2 deletions examples/react/basic-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"@types/react": "^17.0.3",
"@types/react-dom": "^17.0.3",
"@vitejs/plugin-react": "^2.0.0",
"eslint": "7.x",
"eslint-config-prettier": "^8.3.0",
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.8.0",
"typescript": "^4.2.3",
"vite": "^3.0.0"
},
Expand Down
6 changes: 5 additions & 1 deletion examples/react/basic/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"extends": ["react-app", "prettier", "plugin:@tanstack/eslint-plugin-query/recommended"]
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:@tanstack/eslint-plugin-query/recommended"
]
}
9 changes: 4 additions & 5 deletions examples/react/default-query-function/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": ["react-app", "prettier"],
"rules": {
// "eqeqeq": 0,
// "jsx-a11y/anchor-is-valid": 0
}
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended"
]
}
9 changes: 4 additions & 5 deletions examples/react/offline/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": ["react-app", "prettier"],
"rules": {
// "eqeqeq": 0,
// "jsx-a11y/anchor-is-valid": 0
}
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended"
]
}
9 changes: 4 additions & 5 deletions examples/react/playground/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": ["react-app", "prettier"],
"rules": {
// "eqeqeq": 0,
// "jsx-a11y/anchor-is-valid": 0
}
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended"
]
}
5 changes: 3 additions & 2 deletions examples/react/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@callstack/eslint-config": "^10.1.0",
"@callstack/eslint-config": "^13.0.2",
"@expo/config": "^3.3.27",
"@types/react-native": "~0.64.3",
"babel-plugin-module-resolver": "^4.1.0",
"eslint": "^7.32.0",
"eslint": "^8.34.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-prettier": "^4.0.0",
"prettier": "^2.3.2",
"typescript": "~4.4.3"
Expand Down
9 changes: 4 additions & 5 deletions examples/react/react-router/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": ["react-app", "prettier"],
"rules": {
// "eqeqeq": 0,
// "jsx-a11y/anchor-is-valid": 0
}
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended"
]
}
9 changes: 4 additions & 5 deletions examples/react/rick-morty/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": ["react-app", "prettier"],
"rules": {
// "eqeqeq": 0,
// "jsx-a11y/anchor-is-valid": 0
}
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended"
]
}
9 changes: 4 additions & 5 deletions examples/react/simple/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": ["react-app", "prettier"],
"rules": {
// "eqeqeq": 0,
// "jsx-a11y/anchor-is-valid": 0
}
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended"
]
}
9 changes: 4 additions & 5 deletions examples/react/star-wars/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": ["react-app", "prettier"],
"rules": {
// "eqeqeq": 0,
// "jsx-a11y/anchor-is-valid": 0
}
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended"
]
}
9 changes: 4 additions & 5 deletions examples/react/suspense/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": ["react-app", "prettier"],
"rules": {
// "eqeqeq": 0,
// "jsx-a11y/anchor-is-valid": 0
}
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended"
]
}
7 changes: 1 addition & 6 deletions examples/solid/basic-graphql-request/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"parserOptions": {
"project": "./tsconfig.json",
"sourceType": "module"
},
"rules": {
"react/react-in-jsx-scope": "off",
"jsx-a11y/anchor-is-valid": "off"
"project": "./tsconfig.json"
}
}
7 changes: 1 addition & 6 deletions examples/solid/basic-typescript/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"parserOptions": {
"project": "./tsconfig.json",
"sourceType": "module"
},
"rules": {
"react/react-in-jsx-scope": "off",
"jsx-a11y/anchor-is-valid": "off"
"project": "./tsconfig.json"
}
}
7 changes: 1 addition & 6 deletions examples/solid/default-query-function/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"parserOptions": {
"project": "./tsconfig.json",
"sourceType": "module"
},
"rules": {
"react/react-in-jsx-scope": "off",
"jsx-a11y/anchor-is-valid": "off"
"project": "./tsconfig.json"
}
}
7 changes: 1 addition & 6 deletions examples/solid/simple/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{
"extends": ["plugin:@tanstack/eslint-plugin-query/recommended"],
"parserOptions": {
"project": "./tsconfig.json",
"sourceType": "module"
},
"rules": {
"react/react-in-jsx-scope": "off",
"jsx-a11y/accessible-emoji": "off"
"project": "./tsconfig.json"
}
}
22 changes: 7 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,13 @@
"chalk": "^4.1.2",
"concurrently": "^7.1.0",
"current-git-branch": "^1.1.0",
"eslint": "7.x",
"eslint-config-prettier": "^6.11.0",
"eslint-config-react-app": "^5.2.1",
"eslint-config-standard": "^14.1.1",
"eslint-config-standard-react": "^9.2.0",
"eslint-import-resolver-typescript": "^2.7.1",
"eslint-plugin-flowtype": "5.x",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "6.x",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "7.20.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-standard": "^4.0.1",
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-compat": "^4.1.4",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"git-log-parser": "^1.2.0",
"jest": "^27.5.1",
"jsonfile": "^6.1.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/eslint-plugin-query/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const config = {
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
sourceType: 'module',
},
}

Expand Down
2 changes: 1 addition & 1 deletion packages/query-async-storage-persister/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const config = {
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
sourceType: 'module',
},
}

Expand Down
2 changes: 1 addition & 1 deletion packages/query-broadcast-client-experimental/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const config = {
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
sourceType: 'module',
},
}

Expand Down
2 changes: 1 addition & 1 deletion packages/query-core/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const config = {
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
sourceType: 'module',
},
}

Expand Down
2 changes: 1 addition & 1 deletion packages/query-persist-client-core/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const config = {
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
sourceType: 'module',
},
}

Expand Down
2 changes: 1 addition & 1 deletion packages/query-sync-storage-persister/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const config = {
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
sourceType: 'module',
},
}

Expand Down
9 changes: 8 additions & 1 deletion packages/react-query-devtools/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
const config = {
extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
sourceType: 'module',
},
rules: {
'react/display-name': 'off',
'react/jsx-key': ['error', { checkFragmentShorthand: true }],
'react/prop-types': 'off',
'react-hooks/exhaustive-deps': 'error',
},
}

Expand Down
Loading

0 comments on commit ddf6986

Please sign in to comment.