Skip to content

Commit 511c52c

Browse files
[Feature] standardization v1.0.1
1 parent 0eff8d3 commit 511c52c

File tree

4 files changed

+45
-10
lines changed

4 files changed

+45
-10
lines changed

packages/react-ts/index.js

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ module.exports = {
6363
{
6464
'newlines-between': 'always',
6565
pathGroups: [
66-
{ pattern: '{react,next,gatsby}', group: 'builtin', position: 'before', parserOptions: { "matchBase": true } },
66+
{ pattern: '{react,next,next/**,gatsby}', group: 'builtin', position: 'before', parserOptions: { "matchBase": true } },
6767
{
6868
pattern: '@material-ui/**',
6969
group: 'external',
@@ -75,9 +75,15 @@ module.exports = {
7575
group: 'external',
7676
position: 'after'
7777
},
78+
//
79+
{
80+
pattern: '~/{hooks,contexts,state,services,utils,validation,schemas,utilities}/**',
81+
group: 'external',
82+
position: 'after'
83+
},
7884
// Assets and static data
7985
{
80-
pattern: '~/{assets,static,styles,theme,i18n,data}/**',
86+
pattern: '~/{assets,static,styles,theme,i18n,data,constants}/**',
8187
group: 'external',
8288
position: 'after'
8389
},
@@ -93,6 +99,9 @@ module.exports = {
9399
],
94100
'import/named': 'off',
95101
'unused-imports/no-unused-imports': 'warn',
102+
'no-nested-ternary': 'off',
103+
'jsx-a11y/alt-text': 'warn',
104+
'button-has-type': 'off',
96105
camelcase: 'off',
97106

98107
// Typescript
@@ -104,11 +113,17 @@ module.exports = {
104113
'@typescript-eslint/interface-name-prefix': 'off',
105114
'@typescript-eslint/no-empty-interface': 'off',
106115
'@typescript-eslint/no-unsafe-member-access': 'off',
107-
'@typescript-eslint/ban-ts-ignore': 'off',
116+
'@typescript-eslint/ban-ts-ignore': 'warn',
108117
'@typescript-eslint/ban-ts-comment': 'warn',
109118
'@typescript-eslint/explicit-module-boundary-types': 'off',
110119
'@typescript-eslint/no-unused-vars': 'off',
111-
'@typescript-eslint/no-unused-vars-experimental': 'off',
120+
'@typescript-eslint/no-unused-vars-experimental': [
121+
'error',
122+
{
123+
ignoredNamesRegex: '^_',
124+
ignoreArgsIfArgsAfterAreUsed: true
125+
}
126+
],
112127
'@typescript-eslint/explicit-function-return-type': 'off',
113128
'@typescript-eslint/explicit-module-boundary-types': 'off',
114129
'@typescript-eslint/no-use-before-define': 'off',
@@ -128,18 +143,26 @@ module.exports = {
128143
{
129144
selector: 'variable',
130145
format: ['camelCase', 'PascalCase', 'UPPER_CASE', 'snake_case'],
146+
leadingUnderscore: 'allow'
131147
},
132148
{
133149
selector: 'function',
134150
format: ['camelCase', 'PascalCase'],
135151
},
152+
{
153+
selector: 'enum',
154+
format: ['UPPER_CASE', 'PascalCase'],
155+
},
136156
{
137157
selector: 'typeLike',
138158
format: ['PascalCase'],
139-
},
159+
}
140160
],
141161

142162
// React
163+
'react/destructuring-assignment': 'warn',
164+
'react/no-array-index-key': 'warn',
165+
'react/jsx-no-duplicate-props': ['error', { 'ignoreCase': false }],
143166
'react/jsx-props-no-spreading': 'off',
144167
'react/require-default-props': 'off',
145168
'react/jsx-uses-react': 'off',

packages/react-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codica/eslint-config-react-ts",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
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",

packages/react/index.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = {
2626
},
2727
],
2828
'security/detect-object-injection': 'off',
29-
'no-unused-vars': 'off',
29+
'no-unused-vars': ['error', { 'vars': 'all', 'args': 'after-used', 'ignoreRestSiblings': false }],
3030
'no-param-reassign': ['error', { 'props': false }],
3131
'no-underscore-dangle': 'off',
3232
'import/prefer-default-export': 'off',
@@ -35,7 +35,7 @@ module.exports = {
3535
{
3636
'newlines-between': 'always',
3737
pathGroups: [
38-
{ pattern: '{react,next,gatsby}', group: 'builtin', position: 'before', parserOptions: { "matchBase": true } },
38+
{ pattern: '{react,next,next/**,gatsby}', group: 'builtin', position: 'before', parserOptions: { 'matchBase': true } },
3939
{
4040
pattern: '@material-ui/**',
4141
group: 'external',
@@ -47,9 +47,15 @@ module.exports = {
4747
group: 'external',
4848
position: 'after'
4949
},
50+
//
51+
{
52+
pattern: '~/{hooks,contexts,state,services,utils,validation,schemas,utilities}/**',
53+
group: 'external',
54+
position: 'after'
55+
},
5056
// Assets and static data
5157
{
52-
pattern: '~/{assets,static,styles,theme,i18n,data}/**',
58+
pattern: '~/{assets,static,styles,theme,i18n,data,constants}/**',
5359
group: 'external',
5460
position: 'after'
5561
},
@@ -65,13 +71,19 @@ module.exports = {
6571
],
6672
'import/named': 'off',
6773
'unused-imports/no-unused-imports': 'warn',
74+
'no-nested-ternary': 'off',
75+
'jsx-a11y/alt-text': 'warn',
76+
'button-has-type': 'off',
6877
camelcase: 'off',
6978

7079
// React
7180
'react/forbid-prop-types': [
7281
'warn',
7382
{ forbid: ['any'], checkContextTypes: true, checkChildContextTypes: true },
7483
],
84+
'react/destructuring-assignment': 'warn',
85+
'react/no-array-index-key': 'warn',
86+
'react/jsx-no-duplicate-props': ['error', { 'ignoreCase': false }],
7587
'react/jsx-filename-extension': ['error', { extensions: ['.jsx'] }],
7688
'react/jsx-props-no-spreading': 'off',
7789
'react/require-default-props': 'off',

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codica/eslint-config-react",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
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",

0 commit comments

Comments
 (0)