arui-presets-lint 7.3.0 → 7.5.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 CHANGED
@@ -123,6 +123,19 @@ 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': [
@@ -179,11 +192,37 @@ module.exports = {
179
192
  'no-restricted-imports': [
180
193
  'error',
181
194
  {
182
- name: 'lodash',
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]).*/]',
183
220
  message:
184
- 'Please use single imports of lodash functions, e.g `import isEqual from "lodash/isEqual"` instead of `"import { isEqual } from "lodash"`',
221
+ 'Detected mixed language layout within a single word. For example, "case" (first character in ru-encoding)',
185
222
  },
186
223
  ],
224
+ 'import/consistent-type-specifier-style': ['error', 'prefer-inline'],
225
+ 'import/no-duplicates': ['error', { 'prefer-inline': true, considerQueryString: true }],
187
226
  },
188
227
  overrides: [
189
228
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arui-presets-lint",
3
- "version": "7.3.0",
3
+ "version": "7.5.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 \"**/*.{js,jsx,ts,tsx}\" --ext .js,.jsx,.ts,.tsx",
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": {
@@ -36,6 +36,8 @@ module.exports = {
36
36
  'shorthand-property-no-redundant-values': true,
37
37
  'string-no-newline': true,
38
38
  'unit-no-unknown': true,
39
+ 'no-duplicate-selectors': true,
40
+ 'declaration-block-no-duplicate-properties': true,
39
41
 
40
42
  'stylelint-core-vars/use-vars': true,
41
43
  'stylelint-core-vars/use-mixins': true,