Skip to content

Commit e5971dc

Browse files
committed
chore(lint): update eslint and cleanup configuration
1 parent 87b7a0a commit e5971dc

File tree

6 files changed

+1646
-689
lines changed

6 files changed

+1646
-689
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ packages/lumx-angularjs
1111
packages/lumx-react/jest
1212
packages/lumx-react/src/stories/generated
1313
packages/yo-generators
14-
dev-packages/**

.eslintrc.json

Lines changed: 1 addition & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,134 +1,3 @@
11
{
2-
"parser": "@typescript-eslint/parser",
3-
"parserOptions": {
4-
"sourceType": "module",
5-
"project": "./tsconfig.json",
6-
"ecmaFeatures": {
7-
"jsx": true
8-
}
9-
},
10-
"extends": [
11-
"airbnb",
12-
"airbnb/hooks",
13-
"plugin:@typescript-eslint/recommended",
14-
"plugin:react/recommended",
15-
"prettier",
16-
"prettier/react",
17-
"prettier/@typescript-eslint"
18-
],
19-
"globals": {
20-
"angular": "readonly"
21-
},
22-
"plugins": [
23-
"@typescript-eslint",
24-
"prettier",
25-
"eslint-plugin-prettier",
26-
"react",
27-
"jsx-a11y",
28-
"import",
29-
"lumapps"
30-
],
31-
"rules": {
32-
"prettier/prettier": "error",
33-
"react/no-array-index-key": "off",
34-
"react/jsx-filename-extension": [
35-
2,
36-
{
37-
"extensions": [
38-
".js",
39-
".jsx",
40-
".ts",
41-
".tsx"
42-
]
43-
}
44-
],
45-
"react/require-default-props": "off",
46-
"no-continue": "off",
47-
"no-use-before-define": "off",
48-
"no-plusplus": [
49-
"error",
50-
{
51-
"allowForLoopAfterthoughts": true
52-
}
53-
],
54-
"no-restricted-syntax": [
55-
"error",
56-
"ForInStatement",
57-
"LabeledStatement",
58-
"WithStatement"
59-
],
60-
"no-underscore-dangle": "off",
61-
"import/extensions": [
62-
"error",
63-
"never",
64-
{
65-
"svg": "always",
66-
"scss": "always",
67-
"json": "always"
68-
}
69-
],
70-
"import/no-unresolved": "off",
71-
"import/prefer-default-export": "off",
72-
"import/no-extraneous-dependencies": [
73-
"error",
74-
{
75-
"devDependencies": [
76-
"**/*.test.jsx",
77-
"**/*.test.tsx",
78-
"**/*.test.js",
79-
"**/*.test.ts",
80-
"**/*.stories.jsx",
81-
"**/*.stories.tsx",
82-
"**/stories/**",
83-
"**/testing/**"
84-
]
85-
}
86-
],
87-
"react/destructuring-assignment": "off",
88-
"react/prop-types": "off",
89-
"react/jsx-props-no-spreading": "off",
90-
"@typescript-eslint/no-explicit-any": "off",
91-
"@typescript-eslint/no-this-alias": "off",
92-
"@typescript-eslint/explicit-function-return-type": "off",
93-
"@typescript-eslint/no-use-before-define": ["error"],
94-
"no-shadow": "off",
95-
"@typescript-eslint/no-shadow": "error",
96-
"spaced-comment": "off",
97-
"lumapps/do-not-import-all-lodash": 2
98-
},
99-
"env": {
100-
"jest": true,
101-
"browser": true,
102-
"es6": true
103-
},
104-
"overrides": [
105-
{
106-
"files": ["*/stories/*" ,"*.stories.tsx", "**/site-demo/content/**"],
107-
"rules": {
108-
"@typescript-eslint/explicit-module-boundary-types": "off",
109-
"no-alert": "off",
110-
"no-console": "off"
111-
}
112-
}
113-
],
114-
"settings": {
115-
"import/resolver": {
116-
"node": {
117-
"extensions": [
118-
".js",
119-
".ts",
120-
".jsx",
121-
".tsx",
122-
".json"
123-
]
124-
}
125-
},
126-
"import/extensions": [
127-
".js",
128-
".ts",
129-
".mjs",
130-
".jsx",
131-
".tsx"
132-
]
133-
}
2+
"extends": "lumapps"
1343
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
const extensions = ['.js', '.ts', '.jsx', '.tsx'];
2+
3+
module.exports = {
4+
env: {
5+
jest: true,
6+
browser: true,
7+
es6: true,
8+
},
9+
extends: [
10+
'airbnb',
11+
'airbnb/hooks',
12+
'plugin:@typescript-eslint/recommended',
13+
'plugin:react/recommended',
14+
'plugin:prettier/recommended',
15+
],
16+
globals: {
17+
angular: 'readonly',
18+
},
19+
parser: '@typescript-eslint/parser',
20+
parserOptions: {
21+
sourceType: 'module',
22+
project: './tsconfig.json',
23+
ecmaFeatures: {
24+
jsx: true,
25+
},
26+
},
27+
plugins: ['@typescript-eslint', 'react', 'jsx-a11y', 'import', 'lumapps'],
28+
settings: {
29+
'import/resolver': { node: { extensions } },
30+
'import/extensions': extensions,
31+
},
32+
rules: {
33+
'@typescript-eslint/explicit-function-return-type': 'off',
34+
'@typescript-eslint/no-explicit-any': 'off',
35+
'@typescript-eslint/no-shadow': 'error',
36+
'@typescript-eslint/no-this-alias': 'off',
37+
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
38+
'@typescript-eslint/no-use-before-define': ['error'],
39+
'default-param-last': 'off',
40+
'import/extensions': [
41+
'error',
42+
'never',
43+
{
44+
svg: 'always',
45+
scss: 'always',
46+
json: 'always',
47+
},
48+
],
49+
'import/no-extraneous-dependencies': [
50+
'error',
51+
{
52+
devDependencies: ['**/*.test*', '**/*.stories*', '**/testing/**', '**/stories/**'],
53+
},
54+
],
55+
'import/no-unresolved': 'off',
56+
'import/prefer-default-export': 'off',
57+
'lumapps/do-not-import-all-lodash': 2,
58+
'no-continue': 'off',
59+
'no-plusplus': [
60+
'error',
61+
{
62+
allowForLoopAfterthoughts: true,
63+
},
64+
],
65+
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
66+
'no-shadow': 'off',
67+
'no-underscore-dangle': 'off',
68+
'no-use-before-define': 'off',
69+
'react/default-props-match-prop-types': 'off',
70+
'react/destructuring-assignment': 'off',
71+
'react/display-name': 'off',
72+
'react/function-component-definition': 'off',
73+
'react/jsx-filename-extension': [2, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
74+
'react/jsx-no-constructed-context-values': 'off',
75+
'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }],
76+
'react/jsx-props-no-spreading': 'off',
77+
'react/no-array-index-key': 'off',
78+
'react/prop-types': 'off',
79+
'react/require-default-props': 'off',
80+
'spaced-comment': 'off',
81+
},
82+
overrides: [
83+
{
84+
files: ['*/stories/*', '*.stories.tsx', '**/site-demo/content/**'],
85+
rules: {
86+
'@typescript-eslint/explicit-module-boundary-types': 'off',
87+
'no-alert': 'off',
88+
'no-console': 'off',
89+
},
90+
},
91+
// TODO: remove theme switcher
92+
{
93+
files: ['**/MaterialThemeSwitcher/**'],
94+
rules: {
95+
'import/no-webpack-loader-syntax': 'off',
96+
'import/extensions': 'off',
97+
},
98+
},
99+
],
100+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "eslint-config-lumapps",
3+
"private": true,
4+
"version": "3.6.7",
5+
"main": "index.js",
6+
"peerDependencies": {
7+
"eslint": ">=8.24.0",
8+
"typescript": ">=5.3.2"
9+
},
10+
"dependencies": {
11+
"@typescript-eslint/eslint-plugin": "7.4.0",
12+
"@typescript-eslint/parser": "7.4.0",
13+
"eslint-config-airbnb": "19.0.4",
14+
"eslint-config-prettier": "^9.1.0",
15+
"eslint-plugin-import": "2.26.0",
16+
"eslint-plugin-jsx-a11y": "^6.8.0",
17+
"eslint-plugin-lumapps": "3.6.7",
18+
"eslint-plugin-prettier": "5.1.3",
19+
"eslint-plugin-react": "^7.29.4",
20+
"eslint-plugin-react-hooks": "4.6.0",
21+
"eslint-plugin-unused-imports": "^3.0.0"
22+
}
23+
}

package.json

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,16 @@
55
},
66
"description": "The official LumApps Design System (LumX) for AngularJS and React applications",
77
"devDependencies": {
8-
"@typescript-eslint/eslint-plugin": "^5.13.0",
9-
"@typescript-eslint/parser": "^5.13.0",
108
"changelog-verify": "^1.1.2",
119
"es-abstract": "1.17.6",
12-
"eslint": "^7.32.0",
13-
"eslint-config-airbnb": "^18.2.1",
14-
"eslint-config-prettier": "^6.15.0",
15-
"eslint-plugin-import": "^2.22.1",
16-
"eslint-plugin-jsx-a11y": "^6.4.1",
17-
"eslint-plugin-prettier": "^3.2.0",
18-
"eslint-plugin-react": "^7.21.5",
19-
"eslint-plugin-react-hooks": "^4.2.0",
10+
"eslint": "^8.57.0",
11+
"eslint-config-lumapps": "3.6.7",
2012
"husky": "^5.0.4",
2113
"jsx-ast-utils": "^3.1.0",
2214
"lerna": "^3.18.4",
2315
"lint-staged": "^10.5.3",
2416
"postcss-hover-media-feature": "^0.3.1",
25-
"prettier": "^2.2.1",
26-
"prettier-eslint": "^12.0.0",
17+
"prettier": "^3.2.5",
2718
"semver": "^7.6.0",
2819
"stylelint": "^14.9.1",
2920
"stylelint-config-recess-order": "^3.0.0",

0 commit comments

Comments
 (0)