Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Replace ESLint plugins #772

Merged
merged 4 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 14 additions & 17 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ const config = {
reportUnusedDisableDirectives: true,
ignorePatterns: ['**/build', '**/coverage', '**/dist'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'import'],
plugins: ['@typescript-eslint', 'import-x'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/stylistic',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:import-x/recommended',
'plugin:import-x/typescript',
'prettier',
],
env: {
Expand All @@ -26,12 +26,9 @@ const config = {
ecmaVersion: 2020,
},
settings: {
'import/parsers': {
'import-x/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: true,
},
react: {
version: 'detect',
},
Expand All @@ -56,16 +53,16 @@ const config = {
'error',
{ ignoreParameters: true },
],
'import/default': 'off',
'import/export': 'off',
'import/namespace': 'off',
'import/newline-after-import': 'error',
'import/no-cycle': 'error',
'import/no-duplicates': 'off',
'import/no-named-as-default-member': 'off',
'import/no-unresolved': ['error', { ignore: ['^@tanstack/'] }],
'import/no-unused-modules': ['off', { unusedExports: true }],
'import/order': [
'import-x/default': 'off',
'import-x/export': 'off',
'import-x/namespace': 'off',
'import-x/newline-after-import': 'error',
'import-x/no-cycle': 'error',
'import-x/no-duplicates': 'off',
'import-x/no-named-as-default-member': 'off',
'import-x/no-unresolved': 'off',
'import-x/no-unused-modules': ['off', { unusedExports: true }],
'import-x/order': [
'error',
{
groups: [
Expand Down
11 changes: 1 addition & 10 deletions examples/lit/simple/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
// @ts-check

/** @type {import('eslint').Linter.Config} */
const config = {
extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
},
rules: {
'react/no-children-prop': 'off',
},
}
const config = {}

module.exports = config
11 changes: 1 addition & 10 deletions examples/lit/ui-libraries/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
// @ts-check

/** @type {import('eslint').Linter.Config} */
const config = {
extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
},
rules: {
'react/no-children-prop': 'off',
},
}
const config = {}

module.exports = config
3 changes: 0 additions & 3 deletions examples/react/next-server-actions/.eslintrc.cjs

This file was deleted.

5 changes: 1 addition & 4 deletions examples/react/next-server-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"_test:types": "tsc",
"test:eslint": "next lint"
"_test:types": "tsc"
},
"dependencies": {
"@tanstack/react-form": "^0.23.3",
Expand All @@ -18,8 +17,6 @@
"@types/node": "^20.9.0",
"@types/react": "npm:types-react@rc",
"@types/react-dom": "npm:types-react-dom@rc",
"eslint": "^8.57.0",
"eslint-config-next": "15.0.0-rc.0",
"typescript": "5.4.2"
},
"overrides": {
Expand Down
1 change: 0 additions & 1 deletion examples/react/ui-libraries/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"@vitejs/plugin-react": "^4.3.0",
"@vitejs/plugin-react-swc": "^3.6.0",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"typescript": "5.4.2",
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
},
"namespace": "@tanstack",
"devDependencies": {
"@eslint-react/eslint-plugin": "^1.5.16",
"@solidjs/testing-library": "^0.8.6",
"@tanstack/config": "^0.7.11",
"@testing-library/jest-dom": "^6.4.2",
Expand All @@ -55,9 +56,7 @@
"@vitest/coverage-istanbul": "^1.3.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-import-x": "^0.5.1",
"eslint-plugin-react-hooks": "^4.6.2",
"jsdom": "^24.0.0",
"knip": "^5.22.0",
Expand Down
13 changes: 1 addition & 12 deletions packages/lit-form/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
// @ts-check

/** @type {import('eslint').Linter.Config} */
const config = {
extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
},
rules: {
'react/jsx-key': ['error', { checkFragmentShorthand: true }],
'react-hooks/exhaustive-deps': 'error',
'react/no-children-prop': 'off',
},
}
const config = {}

module.exports = config
8 changes: 5 additions & 3 deletions packages/react-form/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

/** @type {import('eslint').Linter.Config} */
const config = {
extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
extends: [
'plugin:@eslint-react/recommended-legacy',
'plugin:react-hooks/recommended',
],
rules: {
'react/jsx-key': ['error', { checkFragmentShorthand: true }],
'react-hooks/exhaustive-deps': 'error',
'react/no-children-prop': 'off',
'react-hooks/exhaustive-deps': 'error',
},
}

Expand Down
Loading
Loading