arui-presets-lint 9.1.0 → 9.1.2

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.ts CHANGED
@@ -71,7 +71,7 @@ export const eslintConfig = [
71
71
  {
72
72
  // Включаем проверку других расширений файлов в eslint-plugin-check-file
73
73
  // ⚠️ НЕ ДОЛЖНО ПЕРЕСЕКАТЬСЯ С ПАТТЕРНОМ, УКАЗАННЫМ ВЫШЕ
74
- files: ['**/*.{yaml,yml,json}'],
74
+ files: ['**/*.{yaml,yml,json,css}'],
75
75
  processor: 'check-file/eslint-processor-check-file',
76
76
  },
77
77
  ] as Linter.Config;
@@ -1,7 +1,7 @@
1
- import { type TSESLint } from '@typescript-eslint/utils';
1
+ import { type Linter } from 'eslint';
2
2
  import unicornPlugin from 'eslint-plugin-unicorn';
3
3
 
4
- export const bestPracticesConfig: TSESLint.FlatConfig.Config = {
4
+ export const bestPracticesConfig: Linter.Config = {
5
5
  ...unicornPlugin.configs.unopinionated,
6
6
  name: 'arui-presets-lint/best-practices',
7
7
  plugins: {
@@ -484,13 +484,7 @@ export const bestPracticesConfig: TSESLint.FlatConfig.Config = {
484
484
 
485
485
  // Требует не использовать фигурные скобки там, где их можно опустить
486
486
  // https://eslint.org/docs/rules/arrow-body-style
487
- 'arrow-body-style': [
488
- 'error',
489
- 'as-needed',
490
- {
491
- requireReturnForObjectLiteral: true,
492
- },
493
- ],
487
+ 'arrow-body-style': ['error', 'as-needed'],
494
488
 
495
489
  // Проверяет вызов super() в конструкторах
496
490
  // https://eslint.org/docs/rules/constructor-super
@@ -1,17 +1,17 @@
1
- import { type TSESLint } from '@typescript-eslint/utils';
1
+ import { type Linter } from 'eslint';
2
2
  import checkFilePlugin from 'eslint-plugin-check-file';
3
3
  import { importX } from 'eslint-plugin-import-x';
4
4
  import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort';
5
5
 
6
- export const importsConfig: TSESLint.FlatConfig.Config = {
6
+ export const importsConfig: Linter.Config = {
7
7
  // https://github.com/un-ts/eslint-plugin-import-x/blob/master/src/config/flat/typescript.ts
8
- ...importX.flatConfigs.typescript,
8
+ ...(importX.flatConfigs.typescript as Linter.Config),
9
9
  name: 'arui-presets-lint/imports',
10
10
  plugins: {
11
11
  'import-x': importX,
12
12
  'simple-import-sort': simpleImportSortPlugin,
13
13
  'check-file': checkFilePlugin,
14
- },
14
+ } as unknown as Linter.Config['plugins'],
15
15
  settings: {
16
16
  ...importX.flatConfigs.typescript.settings,
17
17
  // https://github.com/un-ts/eslint-plugin-import-x?tab=readme-ov-file#settings
@@ -1,8 +1,8 @@
1
- import { type TSESLint } from '@typescript-eslint/utils';
1
+ import { type Linter } from 'eslint';
2
2
  import nodePlugin from 'eslint-plugin-n';
3
3
  import globals from 'globals';
4
4
 
5
- export const nodeRulesConfig: TSESLint.FlatConfig.Config = {
5
+ export const nodeRulesConfig: Linter.Config = {
6
6
  ...nodePlugin.configs['flat/recommended'],
7
7
  name: 'arui-presets-lint/node',
8
8
  languageOptions: {
@@ -1,7 +1,7 @@
1
- import { type TSESLint } from '@typescript-eslint/utils';
1
+ import { type Linter } from 'eslint';
2
2
  import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
3
3
 
4
- export const reactA11yConfig: TSESLint.FlatConfig.Config = {
4
+ export const reactA11yConfig: Linter.Config = {
5
5
  ...jsxA11yPlugin.flatConfigs.recommended,
6
6
  name: 'arui-presets-lint/react-a11y',
7
7
  plugins: {
@@ -1,8 +1,8 @@
1
- import { type TSESLint } from '@typescript-eslint/utils';
1
+ import { type Linter } from 'eslint';
2
2
  import reactPlugin from 'eslint-plugin-react';
3
3
  import reactHooksPlugin from 'eslint-plugin-react-hooks';
4
4
 
5
- export const reactConfig: TSESLint.FlatConfig.Config = {
5
+ export const reactConfig: Linter.Config = {
6
6
  ...reactPlugin.configs.flat.recommended,
7
7
  ...reactHooksPlugin.configs['recommended-latest'],
8
8
 
@@ -10,7 +10,7 @@ export const reactConfig: TSESLint.FlatConfig.Config = {
10
10
  plugins: {
11
11
  react: reactPlugin,
12
12
  'react-hooks': reactHooksPlugin,
13
- },
13
+ } as Linter.Config['plugins'],
14
14
 
15
15
  settings: {
16
16
  react: {
@@ -1,7 +1,7 @@
1
- import { type TSESLint } from '@typescript-eslint/utils';
1
+ import { type Linter } from 'eslint';
2
2
  import globals from 'globals';
3
3
 
4
- export const testsConfig: TSESLint.FlatConfig.Config = {
4
+ export const testsConfig: Linter.Config = {
5
5
  name: 'arui-presets-lint/tests',
6
6
  files: ['**/*.{test,tests,spec}.{js,jsx,ts,tsx,cjs,cts,mjs,mts}'],
7
7
  languageOptions: {
@@ -1,4 +1,5 @@
1
1
  import { type TSESLint } from '@typescript-eslint/utils';
2
+ import { type Linter } from 'eslint';
2
3
  import globals from 'globals';
3
4
  import tseslint from 'typescript-eslint';
4
5
 
@@ -6,15 +7,12 @@ import { bestPracticesConfig } from './best-practices';
6
7
  import { importsConfig } from './imports';
7
8
  import { variablesConfig } from './variables';
8
9
 
9
- const bestPracticesRules = bestPracticesConfig.rules as Record<
10
- string,
11
- TSESLint.FlatConfig.RuleEntry
12
- >;
10
+ const bestPracticesRules = bestPracticesConfig.rules as Record<string, Linter.RuleEntry>;
13
11
 
14
- const importsRules = importsConfig.rules as Record<string, TSESLint.FlatConfig.RuleEntry>;
15
- const variablesRules = variablesConfig.rules as Record<string, TSESLint.FlatConfig.RuleEntry>;
12
+ const importsRules = importsConfig.rules as Record<string, Linter.RuleEntry>;
13
+ const variablesRules = variablesConfig.rules as Record<string, Linter.RuleEntry>;
16
14
 
17
- export const typescriptConfig: TSESLint.FlatConfig.Config = {
15
+ export const typescriptConfig: Linter.Config = {
18
16
  name: 'arui-presets-lint/typescript',
19
17
  files: ['**/*.{ts,tsx,mts,cts,mtsx,ctsx}'],
20
18
  languageOptions: {
@@ -36,12 +34,13 @@ export const typescriptConfig: TSESLint.FlatConfig.Config = {
36
34
  },
37
35
  rules: {
38
36
  // https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked.ts
39
- ...(tseslint.configs.recommendedTypeChecked.reduce((acc, obj) => {
40
- return {
37
+ ...(tseslint.configs.recommendedTypeChecked.reduce(
38
+ (acc, obj) => ({
41
39
  ...acc,
42
40
  ...obj?.rules,
43
- };
44
- }, {}) as TSESLint.FlatConfig.Rules),
41
+ }),
42
+ {},
43
+ ) as TSESLint.FlatConfig.Rules),
45
44
 
46
45
  // Требовать явного указания типов возвращаемых данных и аргументов для методов публичных классов экспортируемых функций и классов
47
46
  // https://typescript-eslint.io/rules/explicit-module-boundary-types
@@ -1,6 +1,6 @@
1
- import { type TSESLint } from '@typescript-eslint/utils';
1
+ import { type Linter } from 'eslint';
2
2
 
3
- export const variablesConfig: TSESLint.FlatConfig.Config = {
3
+ export const variablesConfig: Linter.Config = {
4
4
  name: 'arui-presets-lint/variables',
5
5
  rules: {
6
6
  // Требует/запрещает инициализацию переменных при объявлении
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arui-presets-lint",
3
- "version": "9.1.0",
3
+ "version": "9.1.2",
4
4
  "description": "Config files for arui-apps",
5
5
  "author": "core-ds contributors",
6
6
  "license": "MIT",