Skip to content

Commit

Permalink
chore: update to eslint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
dnlkoch committed Oct 9, 2024
1 parent 7f80ea7 commit c0d3b44
Show file tree
Hide file tree
Showing 60 changed files with 2,828 additions and 5,506 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/* eslint-disable quote-props */
module.exports = {
files: [
'**/*.ts',
'**/*.tsx'
],
extends: [
'@terrestris/eslint-config-typescript',
'@terrestris/eslint-config-typescript-react',
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
22
107 changes: 107 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import reactPlugin from 'eslint-plugin-react';
import importPlugin from 'eslint-plugin-import';
import stylisticEslint from '@stylistic/eslint-plugin'

import ts from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';

import tsEslint from 'typescript-eslint';
import eslint from '@eslint/js';
import globals from 'globals';

import eslintTerrestris from '@terrestris/eslint-config-typescript';

export default tsEslint.config({
extends: [
eslint.configs.recommended,
...tsEslint.configs.recommended,
...tsEslint.configs.stylistic,
importPlugin.flatConfigs.recommended
],
files: [
'**/*.{js,mjs,cjs,ts,mts,jsx,tsx}'
],
plugins: {
react: reactPlugin,
'@stylistic': stylisticEslint
},
languageOptions: {
// globals: globals.browser,
ecmaVersion: 'latest',
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname
}
},
rules: {
...eslintTerrestris.rules,
'max-len': [
'warn',
{
'code': 160
}
],

'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',

'arrow-spacing': 'warn',
'comma-spacing': 'warn',
'comma-dangle': 'warn',
'eol-last': 'warn',
'no-multi-spaces': 'warn',
'no-multiple-empty-lines': ['warn', {
'max': 1
}],
'object-property-newline': 'warn',
'object-curly-newline': ['warn', {
'consistent': true,
'minProperties': 2
}],
'space-before-function-paren': ['warn', {
'anonymous': 'always',
'named': 'never',
'asyncArrow': 'always'
}],

'react/jsx-max-props-per-line': ['warn', {
'maximum': 1
}],
'react/jsx-closing-tag-location': ['warn'],
'react/jsx-closing-bracket-location': ['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
}
}]
},
settings: {
react: {
version: 'detect'
}
}
});
Loading

0 comments on commit c0d3b44

Please sign in to comment.