Skip to content

Commit

Permalink
feat: upgrade eslint to v9
Browse files Browse the repository at this point in the history
  • Loading branch information
hwbllmnn committed Oct 21, 2024
1 parent 0856ad5 commit 9ccc263
Show file tree
Hide file tree
Showing 17 changed files with 3,598 additions and 8,311 deletions.
8 changes: 0 additions & 8 deletions .eslintignore

This file was deleted.

37 changes: 0 additions & 37 deletions .eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
'@babel/preset-react'
],
plugins: [
'@babel/proposal-class-properties',
'@babel/transform-class-properties',
'@babel/proposal-object-rest-spread',
'@babel/proposal-optional-chaining',
[
Expand Down
67 changes: 67 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// @ts-check
import globals from 'globals';
import importPlugin from 'eslint-plugin-import';
import eslintTerrestris from '@terrestris/eslint-config-typescript';
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'
],
ignores: [
'**/*.spec.ts',
'**/jest/__mocks__/*.ts'
],
languageOptions: {
ecmaVersion: 2022,
globals: globals.browser,
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname
},
},
plugins: {
'@stylistic': stylisticEslint
},
rules: {
...eslintTerrestris.rules,
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'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
}
}]
}
});
Loading

0 comments on commit 9ccc263

Please sign in to comment.