@flarian/frontend-preset 1.6.1 → 2.0.1

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.
Files changed (89) hide show
  1. package/README.md +269 -129
  2. package/dist/eslint/config/imports.cjs +8 -3
  3. package/dist/eslint/config/imports.d.cts +5 -3
  4. package/dist/eslint/config/imports.d.mts +5 -3
  5. package/dist/eslint/config/imports.d.ts +5 -3
  6. package/dist/eslint/config/imports.mjs +7 -3
  7. package/dist/eslint/config/javascript.cjs +72 -0
  8. package/dist/eslint/config/javascript.d.cts +7 -0
  9. package/dist/eslint/config/javascript.d.mts +7 -0
  10. package/dist/eslint/config/javascript.d.ts +7 -0
  11. package/dist/eslint/config/javascript.mjs +64 -0
  12. package/dist/eslint/config/json.cjs +31 -9
  13. package/dist/eslint/config/json.d.cts +12 -3
  14. package/dist/eslint/config/json.d.mts +12 -3
  15. package/dist/eslint/config/json.d.ts +12 -3
  16. package/dist/eslint/config/json.mjs +26 -9
  17. package/dist/eslint/config/jsx.cjs +34 -20
  18. package/dist/eslint/config/jsx.d.cts +5 -3
  19. package/dist/eslint/config/jsx.d.mts +5 -3
  20. package/dist/eslint/config/jsx.d.ts +5 -3
  21. package/dist/eslint/config/jsx.mjs +33 -20
  22. package/dist/eslint/config/prettier.cjs +50 -11
  23. package/dist/eslint/config/prettier.d.cts +5 -3
  24. package/dist/eslint/config/prettier.d.mts +5 -3
  25. package/dist/eslint/config/prettier.d.ts +5 -3
  26. package/dist/eslint/config/prettier.mjs +46 -9
  27. package/dist/eslint/config/react.cjs +12 -7
  28. package/dist/eslint/config/react.d.cts +5 -3
  29. package/dist/eslint/config/react.d.mts +5 -3
  30. package/dist/eslint/config/react.d.ts +5 -3
  31. package/dist/eslint/config/react.mjs +11 -7
  32. package/dist/eslint/config/{base.cjs → stylistic.cjs} +292 -186
  33. package/dist/eslint/config/stylistic.d.cts +7 -0
  34. package/dist/eslint/config/stylistic.d.mts +7 -0
  35. package/dist/eslint/config/stylistic.d.ts +7 -0
  36. package/dist/eslint/config/{base.mjs → stylistic.mjs} +291 -182
  37. package/dist/eslint/config/typescript.cjs +43 -0
  38. package/dist/eslint/config/typescript.d.cts +7 -0
  39. package/dist/eslint/config/typescript.d.mts +7 -0
  40. package/dist/eslint/config/typescript.d.ts +7 -0
  41. package/dist/eslint/config/typescript.mjs +36 -0
  42. package/dist/eslint/config/vue.cjs +24 -13
  43. package/dist/eslint/config/vue.d.cts +5 -6
  44. package/dist/eslint/config/vue.d.mts +5 -6
  45. package/dist/eslint/config/vue.d.ts +5 -6
  46. package/dist/eslint/config/vue.mjs +23 -13
  47. package/dist/eslint/index.cjs +37 -21
  48. package/dist/eslint/index.d.cts +10 -8
  49. package/dist/eslint/index.d.mts +10 -8
  50. package/dist/eslint/index.d.ts +10 -8
  51. package/dist/eslint/index.mjs +19 -14
  52. package/dist/index.cjs +13 -12
  53. package/dist/index.d.cts +9 -7
  54. package/dist/index.d.mts +9 -7
  55. package/dist/index.d.ts +9 -7
  56. package/dist/index.mjs +13 -12
  57. package/dist/prettier/config/base.cjs +1 -1
  58. package/dist/prettier/config/base.mjs +1 -1
  59. package/dist/shared/frontend-preset.B9JjGTzu.d.mts +60 -0
  60. package/dist/shared/frontend-preset.BUXYewoh.d.ts +60 -0
  61. package/dist/shared/frontend-preset.CADA8VXw.mjs +37 -0
  62. package/dist/shared/frontend-preset.Cco7BHYd.cjs +5 -0
  63. package/dist/shared/frontend-preset.CnYH3mAs.d.cts +60 -0
  64. package/dist/shared/frontend-preset.CtslHPdG.mjs +3 -0
  65. package/dist/shared/frontend-preset.DEAWyl_Y.d.cts +8 -0
  66. package/dist/shared/frontend-preset.DEAWyl_Y.d.mts +8 -0
  67. package/dist/shared/frontend-preset.DEAWyl_Y.d.ts +8 -0
  68. package/dist/shared/frontend-preset.GULoLGRF.cjs +39 -0
  69. package/dist/stylelint/config/all.d.cts +4 -2
  70. package/dist/stylelint/config/all.d.mts +4 -2
  71. package/dist/stylelint/config/all.d.ts +4 -2
  72. package/dist/stylelint/config/less.cjs +5 -1
  73. package/dist/stylelint/config/less.mjs +5 -1
  74. package/dist/stylelint/config/scss.cjs +5 -1
  75. package/dist/stylelint/config/scss.mjs +5 -1
  76. package/package.json +78 -28
  77. package/dist/eslint/config/all.cjs +0 -36
  78. package/dist/eslint/config/all.d.cts +0 -14
  79. package/dist/eslint/config/all.d.mts +0 -14
  80. package/dist/eslint/config/all.d.ts +0 -14
  81. package/dist/eslint/config/all.mjs +0 -33
  82. package/dist/eslint/config/base.d.cts +0 -8
  83. package/dist/eslint/config/base.d.mts +0 -8
  84. package/dist/eslint/config/base.d.ts +0 -8
  85. package/dist/shared/frontend-preset.BXVU99PK.d.mts +0 -37
  86. package/dist/shared/frontend-preset.Bfc_XKcp.d.cts +0 -37
  87. package/dist/shared/frontend-preset.CbViwkJz.cjs +0 -27
  88. package/dist/shared/frontend-preset.CiCuZ-UD.d.ts +0 -37
  89. package/dist/shared/frontend-preset.DbH8phB0.mjs +0 -25
@@ -0,0 +1,64 @@
1
+ import globals from 'globals';
2
+ import jsPlugin from '@eslint/js';
3
+
4
+ const esLintJavaScriptRules = {
5
+ rules: {
6
+ "arrow-body-style": ["error", "as-needed"],
7
+ curly: ["error", "all"],
8
+ "func-names": ["error", "always"],
9
+ "no-undef": "off",
10
+ "no-alert": "error",
11
+ "no-console": "error",
12
+ "no-var": "error",
13
+ "no-duplicate-imports": [
14
+ "error",
15
+ {
16
+ includeExports: true
17
+ }
18
+ ],
19
+ "no-magic-numbers": [
20
+ "error",
21
+ {
22
+ ignore: [-1, 0, 1],
23
+ ignoreArrayIndexes: true,
24
+ ignoreDefaultValues: true,
25
+ enforceConst: true
26
+ }
27
+ ],
28
+ "no-plusplus": "off",
29
+ "no-restricted-syntax": [
30
+ "error",
31
+ {
32
+ selector: "ForInStatement",
33
+ message: "for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array."
34
+ },
35
+ {
36
+ selector: "LabeledStatement",
37
+ message: "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand."
38
+ },
39
+ {
40
+ selector: "WithStatement",
41
+ message: "`with` is disallowed in strict mode because it makes code impossible to predict and optimize."
42
+ }
43
+ ],
44
+ "no-unused-expressions": [
45
+ "error",
46
+ {
47
+ allowShortCircuit: true
48
+ }
49
+ ]
50
+ }
51
+ };
52
+
53
+ const createJavascriptConfig = () => [
54
+ {
55
+ languageOptions: {
56
+ globals: { ...globals.browser, ...globals.node }
57
+ }
58
+ },
59
+ jsPlugin.configs.recommended,
60
+ esLintJavaScriptRules
61
+ ];
62
+ const javascript = createJavascriptConfig();
63
+
64
+ export { createJavascriptConfig, javascript };
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const stripPlugins = require('../../shared/frontend-preset.Cco7BHYd.cjs');
3
4
  const pluginJsonc = require('eslint-plugin-jsonc');
4
5
 
5
6
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
@@ -10,6 +11,10 @@ const esLintJsonRules = {
10
11
  files: ["**/*.json"],
11
12
  plugins: { pluginJsonc: pluginJsonc__default },
12
13
  rules: {
14
+ // @stylistic правила предназначены для JS/TS и некорректно работают с JSONC парсером
15
+ "@stylistic/lines-around-comment": "off",
16
+ "@stylistic/no-multiple-empty-lines": "off",
17
+ "@stylistic/padded-blocks": "off",
13
18
  "jsonc/indent": ["warn", "tab"],
14
19
  "jsonc/no-comments": "off",
15
20
  "jsonc/comma-dangle": ["error", "never"],
@@ -118,14 +123,31 @@ const esLintJsonTsconfigRules = {
118
123
  }
119
124
  };
120
125
 
121
- const jsonConfig = [
122
- ...pluginJsonc__default.configs["flat/base"],
123
- ...pluginJsonc__default.configs["flat/recommended-with-json"],
124
- ...pluginJsonc__default.configs["flat/recommended-with-json5"],
125
- ...pluginJsonc__default.configs["flat/recommended-with-jsonc"],
126
- esLintJsonRules,
127
- esLintJsonPackageRules,
128
- esLintJsonTsconfigRules
126
+ const createJsonConfig = ({ registerPlugins = true } = {}) => {
127
+ const base = [
128
+ ...pluginJsonc__default.configs["flat/base"],
129
+ ...pluginJsonc__default.configs["flat/recommended-with-json"],
130
+ ...pluginJsonc__default.configs["flat/recommended-with-json5"],
131
+ ...pluginJsonc__default.configs["flat/recommended-with-jsonc"]
132
+ ];
133
+ return [
134
+ ...registerPlugins ? base : base.map(stripPlugins.stripPlugins),
135
+ registerPlugins ? esLintJsonRules : stripPlugins.stripPlugins(esLintJsonRules)
136
+ ];
137
+ };
138
+ const createPackageJsonConfig = ({ registerPlugins = true } = {}) => [
139
+ registerPlugins ? esLintJsonPackageRules : stripPlugins.stripPlugins(esLintJsonPackageRules)
140
+ ];
141
+ const createTsconfigJsonConfig = ({ registerPlugins = true } = {}) => [
142
+ registerPlugins ? esLintJsonTsconfigRules : stripPlugins.stripPlugins(esLintJsonTsconfigRules)
129
143
  ];
144
+ const json = createJsonConfig();
145
+ const packageJson = createPackageJsonConfig();
146
+ const tsconfigJson = createTsconfigJsonConfig();
130
147
 
131
- exports.jsonConfig = jsonConfig;
148
+ exports.createJsonConfig = createJsonConfig;
149
+ exports.createPackageJsonConfig = createPackageJsonConfig;
150
+ exports.createTsconfigJsonConfig = createTsconfigJsonConfig;
151
+ exports.json = json;
152
+ exports.packageJson = packageJson;
153
+ exports.tsconfigJson = tsconfigJson;
@@ -1,5 +1,14 @@
1
- import { Linter } from 'eslint';
1
+ import { C as Config, a as CreateConfig } from '../../shared/frontend-preset.DEAWyl_Y.cjs';
2
+ import 'eslint';
2
3
 
3
- declare const jsonConfig: Linter.Config[];
4
+ declare const createJsonConfig: CreateConfig;
5
+ /**
6
+ * Comment
7
+ */
8
+ declare const createPackageJsonConfig: CreateConfig;
9
+ declare const createTsconfigJsonConfig: CreateConfig;
10
+ declare const json: Config;
11
+ declare const packageJson: Config;
12
+ declare const tsconfigJson: Config;
4
13
 
5
- export { jsonConfig };
14
+ export { createJsonConfig, createPackageJsonConfig, createTsconfigJsonConfig, json, packageJson, tsconfigJson };
@@ -1,5 +1,14 @@
1
- import { Linter } from 'eslint';
1
+ import { C as Config, a as CreateConfig } from '../../shared/frontend-preset.DEAWyl_Y.mjs';
2
+ import 'eslint';
2
3
 
3
- declare const jsonConfig: Linter.Config[];
4
+ declare const createJsonConfig: CreateConfig;
5
+ /**
6
+ * Comment
7
+ */
8
+ declare const createPackageJsonConfig: CreateConfig;
9
+ declare const createTsconfigJsonConfig: CreateConfig;
10
+ declare const json: Config;
11
+ declare const packageJson: Config;
12
+ declare const tsconfigJson: Config;
4
13
 
5
- export { jsonConfig };
14
+ export { createJsonConfig, createPackageJsonConfig, createTsconfigJsonConfig, json, packageJson, tsconfigJson };
@@ -1,5 +1,14 @@
1
- import { Linter } from 'eslint';
1
+ import { C as Config, a as CreateConfig } from '../../shared/frontend-preset.DEAWyl_Y.js';
2
+ import 'eslint';
2
3
 
3
- declare const jsonConfig: Linter.Config[];
4
+ declare const createJsonConfig: CreateConfig;
5
+ /**
6
+ * Comment
7
+ */
8
+ declare const createPackageJsonConfig: CreateConfig;
9
+ declare const createTsconfigJsonConfig: CreateConfig;
10
+ declare const json: Config;
11
+ declare const packageJson: Config;
12
+ declare const tsconfigJson: Config;
4
13
 
5
- export { jsonConfig };
14
+ export { createJsonConfig, createPackageJsonConfig, createTsconfigJsonConfig, json, packageJson, tsconfigJson };
@@ -1,9 +1,14 @@
1
+ import { s as stripPlugins } from '../../shared/frontend-preset.CtslHPdG.mjs';
1
2
  import pluginJsonc from 'eslint-plugin-jsonc';
2
3
 
3
4
  const esLintJsonRules = {
4
5
  files: ["**/*.json"],
5
6
  plugins: { pluginJsonc },
6
7
  rules: {
8
+ // @stylistic правила предназначены для JS/TS и некорректно работают с JSONC парсером
9
+ "@stylistic/lines-around-comment": "off",
10
+ "@stylistic/no-multiple-empty-lines": "off",
11
+ "@stylistic/padded-blocks": "off",
7
12
  "jsonc/indent": ["warn", "tab"],
8
13
  "jsonc/no-comments": "off",
9
14
  "jsonc/comma-dangle": ["error", "never"],
@@ -112,14 +117,26 @@ const esLintJsonTsconfigRules = {
112
117
  }
113
118
  };
114
119
 
115
- const jsonConfig = [
116
- ...pluginJsonc.configs["flat/base"],
117
- ...pluginJsonc.configs["flat/recommended-with-json"],
118
- ...pluginJsonc.configs["flat/recommended-with-json5"],
119
- ...pluginJsonc.configs["flat/recommended-with-jsonc"],
120
- esLintJsonRules,
121
- esLintJsonPackageRules,
122
- esLintJsonTsconfigRules
120
+ const createJsonConfig = ({ registerPlugins = true } = {}) => {
121
+ const base = [
122
+ ...pluginJsonc.configs["flat/base"],
123
+ ...pluginJsonc.configs["flat/recommended-with-json"],
124
+ ...pluginJsonc.configs["flat/recommended-with-json5"],
125
+ ...pluginJsonc.configs["flat/recommended-with-jsonc"]
126
+ ];
127
+ return [
128
+ ...registerPlugins ? base : base.map(stripPlugins),
129
+ registerPlugins ? esLintJsonRules : stripPlugins(esLintJsonRules)
130
+ ];
131
+ };
132
+ const createPackageJsonConfig = ({ registerPlugins = true } = {}) => [
133
+ registerPlugins ? esLintJsonPackageRules : stripPlugins(esLintJsonPackageRules)
134
+ ];
135
+ const createTsconfigJsonConfig = ({ registerPlugins = true } = {}) => [
136
+ registerPlugins ? esLintJsonTsconfigRules : stripPlugins(esLintJsonTsconfigRules)
123
137
  ];
138
+ const json = createJsonConfig();
139
+ const packageJson = createPackageJsonConfig();
140
+ const tsconfigJson = createTsconfigJsonConfig();
124
141
 
125
- export { jsonConfig };
142
+ export { createJsonConfig, createPackageJsonConfig, createTsconfigJsonConfig, json, packageJson, tsconfigJson };
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const stripPlugins = require('../../shared/frontend-preset.Cco7BHYd.cjs');
3
4
  const stylisticJs = require('@stylistic/eslint-plugin');
4
5
 
5
6
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
@@ -7,7 +8,6 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
7
8
  const stylisticJs__default = /*#__PURE__*/_interopDefaultCompat(stylisticJs);
8
9
 
9
10
  const esLintStylisticJsxRules = {
10
- files: ["**/*.{jsx,tsx}"],
11
11
  plugins: { "@stylistic": stylisticJs__default },
12
12
  rules: {
13
13
  /**
@@ -29,12 +29,25 @@ const esLintStylisticJsxRules = {
29
29
  * Запрещает ненужные выражения JSX, когда достаточно одних литералов, или применяет выражения JSX к литералам в дочерних элементах JSX или атрибутах
30
30
  * https://eslint.style/rules/default/jsx-curly-brace-presence
31
31
  */
32
- "@stylistic/jsx-curly-brace-presence": ["warn", { props: "never", children: "never", propElementValues: "always" }],
32
+ "@stylistic/jsx-curly-brace-presence": [
33
+ "warn",
34
+ {
35
+ props: "never",
36
+ children: "never",
37
+ propElementValues: "always"
38
+ }
39
+ ],
33
40
  /**
34
41
  * Обеспечить единообразие переносов строк в фигурных скобках в атрибутах и выражениях JSX
35
42
  * https://eslint.style/rules/default/jsx-curly-newline
36
43
  */
37
- "@stylistic/jsx-curly-newline": ["warn", { multiline: "consistent", singleline: "consistent" }],
44
+ "@stylistic/jsx-curly-newline": [
45
+ "warn",
46
+ {
47
+ multiline: "consistent",
48
+ singleline: "consistent"
49
+ }
50
+ ],
38
51
  /**
39
52
  * Принудительное или запретительное использование пробелов внутри фигурных скобок в атрибутах и выражениях JSX
40
53
  * https://eslint.style/rules/default/jsx-curly-spacing
@@ -71,7 +84,15 @@ const esLintStylisticJsxRules = {
71
84
  * Обеспечить максимальное количество реквизитов в одной строке в JSX
72
85
  * https://eslint.style/rules/default/jsx-max-props-per-line
73
86
  */
74
- "@stylistic/jsx-max-props-per-line": ["warn", { maximum: { single: 3, multi: 1 } }],
87
+ "@stylistic/jsx-max-props-per-line": [
88
+ "warn",
89
+ {
90
+ maximum: {
91
+ single: 3,
92
+ multi: 1
93
+ }
94
+ }
95
+ ],
75
96
  /**
76
97
  * Требовать или запрещать новую строку после элементов и выражений jsx.
77
98
  * https://eslint.style/rules/default/jsx-newline
@@ -104,22 +125,11 @@ const esLintStylisticJsxRules = {
104
125
  * Запретить дополнительные закрывающие теги для компонентов без дочерних элементов
105
126
  * https://eslint.style/rules/default/jsx-self-closing-comp
106
127
  */
107
- "@stylistic/jsx-self-closing-comp": ["warn", { component: true, html: true }],
108
- /**
109
- * Обеспечить сортировку реквизитов в алфавитном порядке
110
- * https://eslint.style/rules/default/jsx-sort-props
111
- */
112
- "@stylistic/jsx-sort-props": [
128
+ "@stylistic/jsx-self-closing-comp": [
113
129
  "warn",
114
130
  {
115
- callbacksLast: true,
116
- shorthandFirst: true,
117
- shorthandLast: true,
118
- multiline: "first",
119
- ignoreCase: true,
120
- noSortAlphabetically: true,
121
- reservedFirst: true,
122
- locale: "auto"
131
+ component: true,
132
+ html: true
123
133
  }
124
134
  ],
125
135
  /**
@@ -154,6 +164,10 @@ const esLintStylisticJsxRules = {
154
164
  }
155
165
  };
156
166
 
157
- const jsxConfig = [esLintStylisticJsxRules];
167
+ const createJsxConfig = ({ registerPlugins = true } = {}) => [
168
+ registerPlugins ? esLintStylisticJsxRules : stripPlugins.stripPlugins(esLintStylisticJsxRules)
169
+ ];
170
+ const jsx = createJsxConfig();
158
171
 
159
- exports.jsxConfig = jsxConfig;
172
+ exports.createJsxConfig = createJsxConfig;
173
+ exports.jsx = jsx;
@@ -1,5 +1,7 @@
1
- import { Linter } from 'eslint';
1
+ import { C as Config, a as CreateConfig } from '../../shared/frontend-preset.DEAWyl_Y.cjs';
2
+ import 'eslint';
2
3
 
3
- declare const jsxConfig: Linter.Config[];
4
+ declare const createJsxConfig: CreateConfig;
5
+ declare const jsx: Config;
4
6
 
5
- export { jsxConfig };
7
+ export { createJsxConfig, jsx };
@@ -1,5 +1,7 @@
1
- import { Linter } from 'eslint';
1
+ import { C as Config, a as CreateConfig } from '../../shared/frontend-preset.DEAWyl_Y.mjs';
2
+ import 'eslint';
2
3
 
3
- declare const jsxConfig: Linter.Config[];
4
+ declare const createJsxConfig: CreateConfig;
5
+ declare const jsx: Config;
4
6
 
5
- export { jsxConfig };
7
+ export { createJsxConfig, jsx };
@@ -1,5 +1,7 @@
1
- import { Linter } from 'eslint';
1
+ import { C as Config, a as CreateConfig } from '../../shared/frontend-preset.DEAWyl_Y.js';
2
+ import 'eslint';
2
3
 
3
- declare const jsxConfig: Linter.Config[];
4
+ declare const createJsxConfig: CreateConfig;
5
+ declare const jsx: Config;
4
6
 
5
- export { jsxConfig };
7
+ export { createJsxConfig, jsx };
@@ -1,7 +1,7 @@
1
+ import { s as stripPlugins } from '../../shared/frontend-preset.CtslHPdG.mjs';
1
2
  import stylisticJs from '@stylistic/eslint-plugin';
2
3
 
3
4
  const esLintStylisticJsxRules = {
4
- files: ["**/*.{jsx,tsx}"],
5
5
  plugins: { "@stylistic": stylisticJs },
6
6
  rules: {
7
7
  /**
@@ -23,12 +23,25 @@ const esLintStylisticJsxRules = {
23
23
  * Запрещает ненужные выражения JSX, когда достаточно одних литералов, или применяет выражения JSX к литералам в дочерних элементах JSX или атрибутах
24
24
  * https://eslint.style/rules/default/jsx-curly-brace-presence
25
25
  */
26
- "@stylistic/jsx-curly-brace-presence": ["warn", { props: "never", children: "never", propElementValues: "always" }],
26
+ "@stylistic/jsx-curly-brace-presence": [
27
+ "warn",
28
+ {
29
+ props: "never",
30
+ children: "never",
31
+ propElementValues: "always"
32
+ }
33
+ ],
27
34
  /**
28
35
  * Обеспечить единообразие переносов строк в фигурных скобках в атрибутах и выражениях JSX
29
36
  * https://eslint.style/rules/default/jsx-curly-newline
30
37
  */
31
- "@stylistic/jsx-curly-newline": ["warn", { multiline: "consistent", singleline: "consistent" }],
38
+ "@stylistic/jsx-curly-newline": [
39
+ "warn",
40
+ {
41
+ multiline: "consistent",
42
+ singleline: "consistent"
43
+ }
44
+ ],
32
45
  /**
33
46
  * Принудительное или запретительное использование пробелов внутри фигурных скобок в атрибутах и выражениях JSX
34
47
  * https://eslint.style/rules/default/jsx-curly-spacing
@@ -65,7 +78,15 @@ const esLintStylisticJsxRules = {
65
78
  * Обеспечить максимальное количество реквизитов в одной строке в JSX
66
79
  * https://eslint.style/rules/default/jsx-max-props-per-line
67
80
  */
68
- "@stylistic/jsx-max-props-per-line": ["warn", { maximum: { single: 3, multi: 1 } }],
81
+ "@stylistic/jsx-max-props-per-line": [
82
+ "warn",
83
+ {
84
+ maximum: {
85
+ single: 3,
86
+ multi: 1
87
+ }
88
+ }
89
+ ],
69
90
  /**
70
91
  * Требовать или запрещать новую строку после элементов и выражений jsx.
71
92
  * https://eslint.style/rules/default/jsx-newline
@@ -98,22 +119,11 @@ const esLintStylisticJsxRules = {
98
119
  * Запретить дополнительные закрывающие теги для компонентов без дочерних элементов
99
120
  * https://eslint.style/rules/default/jsx-self-closing-comp
100
121
  */
101
- "@stylistic/jsx-self-closing-comp": ["warn", { component: true, html: true }],
102
- /**
103
- * Обеспечить сортировку реквизитов в алфавитном порядке
104
- * https://eslint.style/rules/default/jsx-sort-props
105
- */
106
- "@stylistic/jsx-sort-props": [
122
+ "@stylistic/jsx-self-closing-comp": [
107
123
  "warn",
108
124
  {
109
- callbacksLast: true,
110
- shorthandFirst: true,
111
- shorthandLast: true,
112
- multiline: "first",
113
- ignoreCase: true,
114
- noSortAlphabetically: true,
115
- reservedFirst: true,
116
- locale: "auto"
125
+ component: true,
126
+ html: true
117
127
  }
118
128
  ],
119
129
  /**
@@ -148,6 +158,9 @@ const esLintStylisticJsxRules = {
148
158
  }
149
159
  };
150
160
 
151
- const jsxConfig = [esLintStylisticJsxRules];
161
+ const createJsxConfig = ({ registerPlugins = true } = {}) => [
162
+ registerPlugins ? esLintStylisticJsxRules : stripPlugins(esLintStylisticJsxRules)
163
+ ];
164
+ const jsx = createJsxConfig();
152
165
 
153
- export { jsxConfig };
166
+ export { createJsxConfig, jsx };
@@ -1,22 +1,61 @@
1
1
  'use strict';
2
2
 
3
+ require('../../prettier/config/all.cjs');
3
4
  const prettier_config_base = require('../../prettier/config/base.cjs');
4
- const pluginPrettier = require('eslint-config-prettier');
5
- const prettier = require('eslint-plugin-prettier');
5
+ const prettier_config_pug = require('../../prettier/config/pug.cjs');
6
+ const prettier_config_vue = require('../../prettier/config/vue.cjs');
7
+ const prettier_config_yml = require('../../prettier/config/yml.cjs');
8
+ const stripPlugins = require('../../shared/frontend-preset.Cco7BHYd.cjs');
9
+ const prettierPlugin = require('eslint-plugin-prettier');
10
+ const pluginVue = require('eslint-plugin-vue');
11
+ const stylisticJs = require('@stylistic/eslint-plugin');
6
12
 
7
13
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
8
14
 
9
- const pluginPrettier__default = /*#__PURE__*/_interopDefaultCompat(pluginPrettier);
10
- const prettier__default = /*#__PURE__*/_interopDefaultCompat(prettier);
15
+ const prettierPlugin__default = /*#__PURE__*/_interopDefaultCompat(prettierPlugin);
16
+ const pluginVue__default = /*#__PURE__*/_interopDefaultCompat(pluginVue);
17
+ const stylisticJs__default = /*#__PURE__*/_interopDefaultCompat(stylisticJs);
11
18
 
12
- const prettierConfig = [
13
- {
14
- plugins: { prettier: prettier__default },
19
+ const esLintPrettierRules = {
20
+ plugins: {
21
+ "@stylistic": stylisticJs__default
22
+ },
23
+ rules: {
24
+ /**
25
+ * Stylistic override
26
+ */
27
+ "@stylistic/indent": "off",
28
+ "@stylistic/max-len": "off",
29
+ "@stylistic/lines-around-comment": "off",
30
+ "@stylistic/function-paren-newline": "off"
31
+ }
32
+ };
33
+
34
+ const createPrettierConfig = ({ registerPlugins = true } = {}) => {
35
+ const config = {
36
+ plugins: { prettier: prettierPlugin__default },
15
37
  rules: {
16
- ...pluginPrettier__default.rules,
17
38
  "prettier/prettier": ["warn", prettier_config_base.baseConfig]
39
+ },
40
+ ...esLintPrettierRules
41
+ };
42
+ const vueOverride = {
43
+ files: ["**/*.vue"],
44
+ plugins: {
45
+ prettier: prettierPlugin__default,
46
+ vue: pluginVue__default
47
+ },
48
+ rules: {
49
+ "vue/script-indent": "off",
50
+ "prettier/prettier": ["warn", { ...prettier_config_base.baseConfig, ...prettier_config_vue.vueConfig, ...prettier_config_yml.ymlConfig, ...prettier_config_pug.pugConfig }]
18
51
  }
19
- }
20
- ];
52
+ };
53
+ return [
54
+ registerPlugins ? config : stripPlugins.stripPlugins(config),
55
+ registerPlugins ? vueOverride : stripPlugins.stripPlugins(vueOverride)
56
+ ];
57
+ };
58
+ const prettier = createPrettierConfig();
21
59
 
22
- exports.prettierConfig = prettierConfig;
60
+ exports.createPrettierConfig = createPrettierConfig;
61
+ exports.prettier = prettier;
@@ -1,5 +1,7 @@
1
- import { Linter } from 'eslint';
1
+ import { C as Config, a as CreateConfig } from '../../shared/frontend-preset.DEAWyl_Y.cjs';
2
+ import 'eslint';
2
3
 
3
- declare const prettierConfig: Linter.Config[];
4
+ declare const createPrettierConfig: CreateConfig;
5
+ declare const prettier: Config;
4
6
 
5
- export { prettierConfig };
7
+ export { createPrettierConfig, prettier };
@@ -1,5 +1,7 @@
1
- import { Linter } from 'eslint';
1
+ import { C as Config, a as CreateConfig } from '../../shared/frontend-preset.DEAWyl_Y.mjs';
2
+ import 'eslint';
2
3
 
3
- declare const prettierConfig: Linter.Config[];
4
+ declare const createPrettierConfig: CreateConfig;
5
+ declare const prettier: Config;
4
6
 
5
- export { prettierConfig };
7
+ export { createPrettierConfig, prettier };
@@ -1,5 +1,7 @@
1
- import { Linter } from 'eslint';
1
+ import { C as Config, a as CreateConfig } from '../../shared/frontend-preset.DEAWyl_Y.js';
2
+ import 'eslint';
2
3
 
3
- declare const prettierConfig: Linter.Config[];
4
+ declare const createPrettierConfig: CreateConfig;
5
+ declare const prettier: Config;
4
6
 
5
- export { prettierConfig };
7
+ export { createPrettierConfig, prettier };
@@ -1,15 +1,52 @@
1
+ import '../../prettier/config/all.mjs';
1
2
  import { baseConfig } from '../../prettier/config/base.mjs';
2
- import pluginPrettier from 'eslint-config-prettier';
3
- import prettier from 'eslint-plugin-prettier';
3
+ import { pugConfig } from '../../prettier/config/pug.mjs';
4
+ import { vueConfig } from '../../prettier/config/vue.mjs';
5
+ import { ymlConfig } from '../../prettier/config/yml.mjs';
6
+ import { s as stripPlugins } from '../../shared/frontend-preset.CtslHPdG.mjs';
7
+ import prettierPlugin from 'eslint-plugin-prettier';
8
+ import pluginVue from 'eslint-plugin-vue';
9
+ import stylisticJs from '@stylistic/eslint-plugin';
4
10
 
5
- const prettierConfig = [
6
- {
7
- plugins: { prettier },
11
+ const esLintPrettierRules = {
12
+ plugins: {
13
+ "@stylistic": stylisticJs
14
+ },
15
+ rules: {
16
+ /**
17
+ * Stylistic override
18
+ */
19
+ "@stylistic/indent": "off",
20
+ "@stylistic/max-len": "off",
21
+ "@stylistic/lines-around-comment": "off",
22
+ "@stylistic/function-paren-newline": "off"
23
+ }
24
+ };
25
+
26
+ const createPrettierConfig = ({ registerPlugins = true } = {}) => {
27
+ const config = {
28
+ plugins: { prettier: prettierPlugin },
8
29
  rules: {
9
- ...pluginPrettier.rules,
10
30
  "prettier/prettier": ["warn", baseConfig]
31
+ },
32
+ ...esLintPrettierRules
33
+ };
34
+ const vueOverride = {
35
+ files: ["**/*.vue"],
36
+ plugins: {
37
+ prettier: prettierPlugin,
38
+ vue: pluginVue
39
+ },
40
+ rules: {
41
+ "vue/script-indent": "off",
42
+ "prettier/prettier": ["warn", { ...baseConfig, ...vueConfig, ...ymlConfig, ...pugConfig }]
11
43
  }
12
- }
13
- ];
44
+ };
45
+ return [
46
+ registerPlugins ? config : stripPlugins(config),
47
+ registerPlugins ? vueOverride : stripPlugins(vueOverride)
48
+ ];
49
+ };
50
+ const prettier = createPrettierConfig();
14
51
 
15
- export { prettierConfig };
52
+ export { createPrettierConfig, prettier };
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const stripPlugins = require('../../shared/frontend-preset.Cco7BHYd.cjs');
3
4
  const pluginReact = require('eslint-plugin-react');
4
5
  const pluginReactHooks = require('eslint-plugin-react-hooks');
5
6
 
@@ -44,11 +45,15 @@ const esLintReactHooksRules = {
44
45
  }
45
46
  };
46
47
 
47
- const reactConfig = [
48
- pluginReact__default.configs.flat.recommended,
49
- pluginReact__default.configs.flat["jsx-runtime"],
50
- esLintReactRules,
51
- esLintReactHooksRules
52
- ];
48
+ const createReactConfig = ({ registerPlugins = true } = {}) => {
49
+ const base = [pluginReact__default.configs.flat.recommended, pluginReact__default.configs.flat["jsx-runtime"]];
50
+ return [
51
+ ...registerPlugins ? base : base.map(stripPlugins.stripPlugins),
52
+ registerPlugins ? esLintReactRules : stripPlugins.stripPlugins(esLintReactRules),
53
+ registerPlugins ? esLintReactHooksRules : stripPlugins.stripPlugins(esLintReactHooksRules)
54
+ ];
55
+ };
56
+ const react = createReactConfig();
53
57
 
54
- exports.reactConfig = reactConfig;
58
+ exports.createReactConfig = createReactConfig;
59
+ exports.react = react;