Skip to content

Commit bb864e9

Browse files
authored
Merge pull request #852 from terrestris/dev-deps
Chore(next): Include react specific eslint v9 rules
2 parents f4f67d2 + 9b7243d commit bb864e9

File tree

51 files changed

+1688
-3223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1688
-3223
lines changed

.husky/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# diasble CI
1+
# disable CI
22
[ -n "$CI" ] && exit 0
33

44
npx --no-install commitlint --edit $1

babel.config.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ module.exports = {
55
'@babel/preset-react'
66
],
77
plugins: [
8-
'@babel/transform-class-properties',
9-
'@babel/proposal-object-rest-spread',
10-
'@babel/proposal-optional-chaining',
8+
'@babel/plugin-transform-optional-chaining',
9+
['@babel/plugin-transform-class-properties', { loose: false }],
1110
[
1211
'import',
1312
{

eslint.config.mjs

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// @ts-check
22
import globals from 'globals';
3+
import reactHooks from 'eslint-plugin-react-hooks';
34
import importPlugin from 'eslint-plugin-import';
5+
import eslintReact from 'eslint-plugin-react';
46
import eslintTerrestris from '@terrestris/eslint-config-typescript';
7+
import eslintReactTerrestris from '@terrestris/eslint-config-typescript-react';
58
import eslint from '@eslint/js';
69
import tsEslint from 'typescript-eslint';
710
import stylisticEslint from '@stylistic/eslint-plugin'
@@ -14,28 +17,47 @@ export default tsEslint.config({
1417
importPlugin.flatConfigs.recommended
1518
],
1619
files: [
17-
'**/*.ts'
20+
'**/*.{ts,tsx}'
1821
],
1922
ignores: [
20-
'**/*.spec.ts',
21-
'**/jest/__mocks__/*.ts'
23+
'**/test/setup.ts',
24+
'**/e2e-tests/**.ts',
25+
'**/global-setup.ts',
26+
'**/playwright.config.ts',
27+
'**/*.spec.{ts,tsx}',
28+
'coverage/**/*.{js,ts*}',
29+
'dist/**/*.{js,ts*}'
2230
],
31+
settings: {
32+
react: {
33+
version: 'detect'
34+
}
35+
},
2336
languageOptions: {
2437
ecmaVersion: 2022,
2538
globals: globals.browser,
2639
parserOptions: {
2740
project: true,
2841
tsconfigRootDir: import.meta.dirname
29-
},
42+
}
3043
},
3144
plugins: {
32-
'@stylistic': stylisticEslint
45+
'react-hooks': reactHooks,
46+
'@stylistic': stylisticEslint,
47+
react: eslintReact,
48+
'@typescript-eslint/eslint-plugin': tsEslint
3349
},
3450
rules: {
3551
...eslintTerrestris.rules,
36-
'@typescript-eslint/member-ordering': 'off',
52+
...eslintReactTerrestris.rules,
53+
...reactHooks.configs.recommended.rules,
54+
'react/jsx-closing-tag-location': ['warn'],
55+
'react/jsx-closing-bracket-location': ['warn'],
56+
'react-hooks/rules-of-hooks': ['warn'],
57+
'react-hooks/exhaustive-deps': ['warn'],
3758
'@typescript-eslint/no-empty-object-type': 'off',
3859
'@typescript-eslint/no-unused-vars': 'warn',
60+
'import/no-named-as-default': 'off',
3961
'import/no-unresolved': 'off',
4062
'import/named': 'off',
4163
'import/order': ['warn', {

jest.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ module.exports = {
1818
'^.+\\.tsx?$': 'babel-jest'
1919
},
2020
moduleNameMapper: {
21-
// eslint-disable-next-line max-len
2221
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/test/__mocks__/fileMock.js',
2322
'\\.(css|less|scss)$': '<rootDir>/test/__mocks__/styleMock.js',
2423
'shogunApplicationConfig': '<rootDir>/assets/fallbackConfig.js'

0 commit comments

Comments
 (0)