Skip to content

Commit

Permalink
chore(eslint): remove typescript from base config
Browse files Browse the repository at this point in the history
  • Loading branch information
araujogui committed Sep 24, 2024
1 parent 767fc0e commit fb095b1
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 22 deletions.
13 changes: 11 additions & 2 deletions apps/site/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { FlatCompat } from '@eslint/eslintrc';
import importX from 'eslint-plugin-import-x';
import * as mdx from 'eslint-plugin-mdx';
import react from 'eslint-plugin-react';
import storybook from 'eslint-plugin-storybook';
Expand All @@ -22,9 +23,17 @@ const compatConfig = compat.config({
export default tseslint.config(
...baseConfig,
{
extends: [react.configs.flat['jsx-runtime'], ...compatConfig],
extends: [
react.configs.flat['jsx-runtime'],
...tseslint.configs.recommended,
importX.flatConfigs.typescript,
...compatConfig,
],
files: ['**/*.{js,md,mdx,mjs,ts,tsx}'],
rules: {
'@typescript-eslint/array-type': ['error', { default: 'generic' }],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-require-imports': 'off',
'@next/next/no-duplicate-head': 'off',
},
settings: {
Expand All @@ -48,7 +57,7 @@ export default tseslint.config(
{
files: ['**/*.{mdx,tsx}'],
rules: {
// '@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'react/no-unescaped-entities': 'off',
'react/function-component-definition': [
'error',
Expand Down
2 changes: 2 additions & 0 deletions apps/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"@types/react-dom": "^18.3.0",
"@types/semver": "~7.5.8",
"eslint-config-next": "~14.2.11",
"eslint-import-resolver-typescript": "~3.6.3",
"eslint-plugin-mdx": "~3.1.5",
"eslint-plugin-react": "~7.36.1",
"eslint-plugin-react-hooks": "5.1.0-rc-4c58fce7-20240904",
Expand All @@ -120,6 +121,7 @@
"stylelint-order": "6.0.4",
"stylelint-selector-bem-pattern": "4.0.1",
"typescript": "~5.5.4",
"typescript-eslint": "~8.5.0",
"user-agent-data-types": "0.4.2"
}
}
10 changes: 1 addition & 9 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,12 @@ export default tseslint.config(
],
},
{
extends: [
js.configs.recommended,
importX.flatConfigs.recommended,
importX.flatConfigs.typescript,
...tseslint.configs.recommended,
],
extends: [js.configs.recommended, importX.flatConfigs.recommended],
files: ['**/*.{js,mjs,ts,tsx}'],
plugins: {
'no-relative-import-paths': noRelativeImportPaths,
},
rules: {
'@typescript-eslint/array-type': ['error', { default: 'generic' }],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-require-imports': 'off',
'import-x/namespace': 'off',
'import-x/no-named-as-default-member': 'off',
'import-x/no-unresolved': 'off',
Expand Down
11 changes: 6 additions & 5 deletions package-lock.json

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

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,10 @@
"commitizen": "4.3.0",
"cz-conventional-changelog": "3.3.0",
"eslint": "~9.10.0",
"eslint-import-resolver-typescript": "~3.6.3",
"eslint-plugin-import-x": "~4.2.1",
"eslint-plugin-no-relative-import-paths": "~1.5.5",
"prettier": "3.3.3",
"prettier-plugin-tailwindcss": "0.6.6",
"typescript": "~5.5.4",
"typescript-eslint": "~8.5.0"
"prettier-plugin-tailwindcss": "0.6.6"
},
"overrides": {
"eslint-config-next": {
Expand Down
15 changes: 14 additions & 1 deletion packages/i18n/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
import importX from 'eslint-plugin-import-x';
import tseslint from 'typescript-eslint';

// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
import baseConfig from '../../eslint.config.js';

export default [...baseConfig];
export default [
...baseConfig,
...tseslint.configs.recommended,
importX.flatConfigs.typescript,
{
rules: {
'@typescript-eslint/array-type': ['error', { default: 'generic' }],
'@typescript-eslint/consistent-type-imports': 'error',
},
},
];
4 changes: 3 additions & 1 deletion packages/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"node": ">=20"
},
"devDependencies": {
"typescript": "~5.5.4"
"eslint-import-resolver-typescript": "~3.6.3",
"typescript": "~5.5.4",
"typescript-eslint": "~8.5.0"
}
}

0 comments on commit fb095b1

Please sign in to comment.