arui-presets-lint 7.2.0 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/eslint/index.js +47 -3
- package/package.json +3 -3
package/eslint/index.js
CHANGED
|
@@ -123,13 +123,31 @@ module.exports = {
|
|
|
123
123
|
{ functions: false, classes: true, variables: true },
|
|
124
124
|
],
|
|
125
125
|
'@typescript-eslint/default-param-last': 'off',
|
|
126
|
+
'@typescript-eslint/consistent-type-imports': [
|
|
127
|
+
'error',
|
|
128
|
+
{
|
|
129
|
+
prefer: 'type-imports',
|
|
130
|
+
fixStyle: 'inline-type-imports',
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
'@typescript-eslint/consistent-type-exports': [
|
|
134
|
+
'error',
|
|
135
|
+
{
|
|
136
|
+
fixMixedExportsWithInlineTypeSpecifier: true,
|
|
137
|
+
},
|
|
138
|
+
],
|
|
126
139
|
|
|
127
140
|
// Imports, file extensions
|
|
128
141
|
'import/no-extraneous-dependencies': [
|
|
129
142
|
'error',
|
|
130
143
|
{ devDependencies: ['**/*.{stories,test,tests,spec}.{js,jsx,ts,tsx}'] },
|
|
131
144
|
],
|
|
132
|
-
'import/no-cycle':
|
|
145
|
+
'import/no-cycle': [
|
|
146
|
+
'error',
|
|
147
|
+
{
|
|
148
|
+
ignoreExternal: true,
|
|
149
|
+
},
|
|
150
|
+
],
|
|
133
151
|
'import/prefer-default-export': 'off',
|
|
134
152
|
'import/no-unresolved': 'off',
|
|
135
153
|
'import/extensions': 'off',
|
|
@@ -174,11 +192,37 @@ module.exports = {
|
|
|
174
192
|
'no-restricted-imports': [
|
|
175
193
|
'error',
|
|
176
194
|
{
|
|
177
|
-
|
|
195
|
+
paths: [
|
|
196
|
+
{
|
|
197
|
+
name: 'lodash',
|
|
198
|
+
message:
|
|
199
|
+
'Import specific parts of "lodash" explicitly, for example: `import isEqual from "lodash/isEqual"`. This will help ensure greater consistency in builds and make it easier to align versions across projects',
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
patterns: [
|
|
203
|
+
{
|
|
204
|
+
group: ['lodash.*'],
|
|
205
|
+
message:
|
|
206
|
+
'Import specific parts of "lodash" explicitly, for example: `import isEqual from "lodash/isEqual"`. This will help ensure greater consistency in builds and make it easier to align versions across projects',
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
'no-restricted-syntax': [
|
|
212
|
+
'error',
|
|
213
|
+
{
|
|
214
|
+
selector: 'TSTypeReference[typeName.name="PropsWithChildren"]',
|
|
215
|
+
message:
|
|
216
|
+
'Do not use "PropsWithChildren". Use explicit children typing instead, for example: "children?: ReactNode";',
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
selector: 'Literal[value=/.*(?:[a-zA-Z][а-яА-ЯёЁ]|[а-яА-ЯёЁ][a-zA-Z]).*/]',
|
|
178
220
|
message:
|
|
179
|
-
'
|
|
221
|
+
'Detected mixed language layout within a single word. For example, "case" (first character in ru-encoding)',
|
|
180
222
|
},
|
|
181
223
|
],
|
|
224
|
+
'import/consistent-type-specifier-style': ['error', 'prefer-inline'],
|
|
225
|
+
'import/no-duplicates': ['error', { 'prefer-inline': true, considerQueryString: true }],
|
|
182
226
|
},
|
|
183
227
|
overrides: [
|
|
184
228
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arui-presets-lint",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0",
|
|
4
4
|
"description": "Config files for arui-apps",
|
|
5
5
|
"author": "core-ds contributors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"scripts": {
|
|
68
68
|
"precommit": "lint-staged",
|
|
69
69
|
"test": "yarn lint:scripts && eslint-config-prettier ./eslint/index.js && yarn lint:css && prettier --check \"./**/*.{ts,tsx,js,jsx,css,json}\"",
|
|
70
|
-
"lint:css": "stylelint **/*.css",
|
|
71
|
-
"lint:scripts": "eslint
|
|
70
|
+
"lint:css": "stylelint '**/*.css'",
|
|
71
|
+
"lint:scripts": "eslint '**/*.{js,jsx,ts,tsx}' --ext .js,.jsx,.ts,.tsx",
|
|
72
72
|
"lint:fix": "yarn lint:css --fix && yarn lint:scripts --fix && prettier --write \"./**/*.{ts,tsx,js,jsx,css,json}\""
|
|
73
73
|
},
|
|
74
74
|
"lint-staged": {
|