Skip to content

Commit 814f602

Browse files
committed
[Feature] react-ts v2
1 parent 511c52c commit 814f602

File tree

3 files changed

+508
-467
lines changed

3 files changed

+508
-467
lines changed

packages/react-ts/index.js

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ module.exports = {
1414
'plugin:import/warnings',
1515
'plugin:import/typescript',
1616
'plugin:@typescript-eslint/recommended',
17-
'prettier/react',
18-
'prettier/@typescript-eslint'
17+
'prettier',
1918
],
20-
plugins: ['@typescript-eslint', 'security', 'react', 'unused-imports'],
19+
plugins: ['@typescript-eslint', 'security', 'react'],
2120
parserOptions: {
2221
tsconfigRootDir: __dirname,
2322
project: './tsconfig.json',
@@ -65,7 +64,7 @@ module.exports = {
6564
pathGroups: [
6665
{ pattern: '{react,next,next/**,gatsby}', group: 'builtin', position: 'before', parserOptions: { "matchBase": true } },
6766
{
68-
pattern: '@material-ui/**',
67+
pattern: '@mui/**',
6968
group: 'external',
7069
position: 'after'
7170
},
@@ -77,13 +76,13 @@ module.exports = {
7776
},
7877
//
7978
{
80-
pattern: '~/{hooks,contexts,state,services,utils,validation,schemas,utilities}/**',
79+
pattern: '~/{hooks,contexts,state,services,utils,validation}/**',
8180
group: 'external',
8281
position: 'after'
8382
},
8483
// Assets and static data
8584
{
86-
pattern: '~/{assets,static,styles,theme,i18n,data,constants}/**',
85+
pattern: '~/{assets,static,styles,theme,i18n,data}/**',
8786
group: 'external',
8887
position: 'after'
8988
},
@@ -98,9 +97,7 @@ module.exports = {
9897
}
9998
],
10099
'import/named': 'off',
101-
'unused-imports/no-unused-imports': 'warn',
102100
'no-nested-ternary': 'off',
103-
'jsx-a11y/alt-text': 'warn',
104101
'button-has-type': 'off',
105102
camelcase: 'off',
106103

@@ -115,15 +112,6 @@ module.exports = {
115112
'@typescript-eslint/no-unsafe-member-access': 'off',
116113
'@typescript-eslint/ban-ts-ignore': 'warn',
117114
'@typescript-eslint/ban-ts-comment': 'warn',
118-
'@typescript-eslint/explicit-module-boundary-types': 'off',
119-
'@typescript-eslint/no-unused-vars': 'off',
120-
'@typescript-eslint/no-unused-vars-experimental': [
121-
'error',
122-
{
123-
ignoredNamesRegex: '^_',
124-
ignoreArgsIfArgsAfterAreUsed: true
125-
}
126-
],
127115
'@typescript-eslint/explicit-function-return-type': 'off',
128116
'@typescript-eslint/explicit-module-boundary-types': 'off',
129117
'@typescript-eslint/no-use-before-define': 'off',
@@ -162,12 +150,12 @@ module.exports = {
162150
// React
163151
'react/destructuring-assignment': 'warn',
164152
'react/no-array-index-key': 'warn',
165-
'react/jsx-no-duplicate-props': ['error', { 'ignoreCase': false }],
153+
// 'react/jsx-no-duplicate-props': ['error', { 'ignoreCase': false }],
166154
'react/jsx-props-no-spreading': 'off',
167155
'react/require-default-props': 'off',
168156
'react/jsx-uses-react': 'off',
169157
'react/react-in-jsx-scope': 'off',
170158
'react/prop-types': 'off',
171159
'react/display-name': 'off'
172160
}
173-
}
161+
}

packages/react-ts/package.json

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "@codica/eslint-config-react-ts",
3-
"version": "1.0.1",
3+
"version": "2.0.0",
44
"description": "This package provides Codica's .eslintrc as an extensible shared config.",
55
"author": "Eugene Volkov (https://github.com/jk-volkov)",
66
"license": "MIT",
77
"private": false,
88
"repository": {
99
"type": "git",
10-
"url": "https://github.com/codica2/eslint-config-codica"
10+
"url": "git+https://github.com/codica2/eslint-config-codica.git"
1111
},
1212
"main": "index.js",
1313
"files": [
@@ -16,8 +16,8 @@
1616
"scripts": {
1717
"compile": "tsc",
1818
"lint": "eslint index.js",
19-
"lint:fix": "./node_modules/.bin/eslint . --fix",
20-
"prettier": "./node_modules/.bin/prettier --write ./**/*.js",
19+
"lint:fix": "eslint . --fix",
20+
"prettier": "prettier --write ./**/*.js",
2121
"publish": "npm publish --access public"
2222
},
2323
"eslintConfig": {
@@ -32,26 +32,30 @@
3232
"codica"
3333
],
3434
"dependencies": {
35-
"@typescript-eslint/eslint-plugin": "^4.28.0",
36-
"@typescript-eslint/parser": "^4.28.0",
37-
"eslint-config-airbnb-typescript": "^10.0.2",
38-
"eslint-config-prettier": "^6.12.0",
39-
"eslint-import-resolver-typescript": "^2.4.0",
40-
"eslint-plugin-import": "^2.23.4",
41-
"eslint-plugin-jsx-a11y": "^6.3.1",
42-
"eslint-plugin-prettier": "^3.4.0",
43-
"eslint-plugin-react": "^7.24.0",
44-
"eslint-plugin-react-hooks": "^4.1.2",
45-
"eslint-plugin-security": "^1.4.0",
46-
"eslint-plugin-unused-imports": "^1.1.1"
35+
"@typescript-eslint/eslint-plugin": "^5.21.0",
36+
"@typescript-eslint/parser": "^5.21.0",
37+
"eslint-config-airbnb-typescript": "^17.0.0",
38+
"eslint-config-prettier": "^8.5.0",
39+
"eslint-import-resolver-typescript": "^2.7.1",
40+
"eslint-plugin-import": "^2.26.0",
41+
"eslint-plugin-jsx-a11y": "^6.5.1",
42+
"eslint-plugin-prettier": "^4.0.0",
43+
"eslint-plugin-react": "^7.29.4",
44+
"eslint-plugin-react-hooks": "^4.5.0",
45+
"eslint-plugin-security": "^1.5.0",
46+
"eslint-plugin-unused-imports": "^2.0.0"
4747
},
4848
"peerDependencies": {
49-
"eslint": ">=7.8",
49+
"eslint": ">=8.0",
5050
"prettier": ">=2.0",
51-
"react": ">=16.0",
51+
"react": ">=17.0",
5252
"typescript": ">=4.0"
5353
},
5454
"devDependencies": {
55-
"typescript": "^4.3.4"
56-
}
55+
"typescript": "^4.6.4"
56+
},
57+
"bugs": {
58+
"url": "https://github.com/codica2/eslint-config-codica/issues"
59+
},
60+
"homepage": "https://github.com/codica2/eslint-config-codica#readme"
5761
}

0 commit comments

Comments
 (0)