Skip to content

Commit

Permalink
Merge pull request #4070 from ahennr/dep-updates
Browse files Browse the repository at this point in the history
chore(eslint): upgrade to v9 and fix resulting lint errors / issues
  • Loading branch information
ahennr authored Jan 24, 2025
2 parents de3b565 + 6ce69a1 commit 4ccc936
Show file tree
Hide file tree
Showing 53 changed files with 14,371 additions and 11,507 deletions.
19 changes: 0 additions & 19 deletions .eslintrc.cjs

This file was deleted.

24 changes: 0 additions & 24 deletions .eslintrc.styleguide.cjs

This file was deleted.

1 change: 0 additions & 1 deletion babel.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module.exports = {
}
},
plugins: [
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-transform-class-properties'
]
};
94 changes: 94 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// @ts-check
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import importPlugin from 'eslint-plugin-import';
import eslintReact from 'eslint-plugin-react';
import eslintMarkdown from 'eslint-plugin-markdown';
import eslintTerrestris from '@terrestris/eslint-config-typescript';
import eslintReactTerrestris from '@terrestris/eslint-config-typescript-react';
import eslint from '@eslint/js';
import tsEslint from 'typescript-eslint';
import stylisticEslint from '@stylistic/eslint-plugin'

export default tsEslint.config({
extends: [
eslint.configs.recommended,
...tsEslint.configs.recommended,
...tsEslint.configs.stylistic,
importPlugin.flatConfigs.recommended
],
files: [
'**/*.{ts,tsx}',
],
ignores: [
'**/*.spec.{ts,tsx}',
'**/coverage/**/*.{js,ts*}',
'**/dist/**/*.spec.{js,ts*}',
'**/dist/**/*.{js,ts*}',
'**/e2e-tests/**.ts',
'**/global-setup.ts',
'**/playwright.config.ts',
'**/test/setup.ts',
'src/Util/antdTestQueries.ts'
],
settings: {
react: {
version: 'detect'
}
},
languageOptions: {
ecmaVersion: 2022,
globals: globals.browser,
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname
}
},
plugins: {
'react-hooks': reactHooks,
'@stylistic': stylisticEslint,
react: eslintReact,
'@typescript-eslint/eslint-plugin': tsEslint
},
rules: {
...eslintTerrestris.rules,
...eslintReactTerrestris.rules,
...reactHooks.configs.recommended.rules,
...eslintMarkdown.configs.recommended.rules,
'no-debugger': 'error',
'react/jsx-closing-tag-location': ['warn'],
'react/jsx-closing-bracket-location': ['warn'],
'react-hooks/rules-of-hooks': ['warn'],
'react-hooks/exhaustive-deps': ['warn'],
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'import/no-named-as-default': 'off',
'import/no-unresolved': 'off',
'import/named': 'off',
'import/order': ['warn', {
groups: [
'builtin',
'external',
'parent',
'sibling',
'index',
'object'
],
pathGroups: [{
pattern: 'react',
group: 'external',
position: 'before'
}, {
pattern: '@terrestris/**',
group: 'external',
position: 'after'
}],
pathGroupsExcludedImportTypes: ['react'],
'newlines-between': 'always-and-inside-groups',
alphabetize: {
order: 'asc',
caseInsensitive: true
}
}]
}
});
21 changes: 21 additions & 0 deletions eslintrc.styleguide.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// @ts-check
import markdown from 'eslint-plugin-markdown';
import reactGeo from './eslint.config.mjs';
import tsEslint from 'typescript-eslint';

export default tsEslint.config({
extends: [
...reactGeo,
...markdown.configs.recommended
],
plugins: {
'markdown': markdown
},
files: [
'src/**/*.{md,mkdn,mdown,markdown}'
],
processor: 'markdown/markdown',
rules: {
'@typescript-eslint/semi': 'off'
}
});
Loading

0 comments on commit 4ccc936

Please sign in to comment.