@vyriy/eslint-config 0.6.0 → 0.6.6
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/README.md +2 -0
- package/index.js +31 -0
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -12,6 +12,7 @@ This package provides the base ESLint setup used in Vyriy repositories for:
|
|
|
12
12
|
- React Hooks
|
|
13
13
|
- Storybook
|
|
14
14
|
- Jest
|
|
15
|
+
- YAML
|
|
15
16
|
- `import-x` import rules and TypeScript-aware resolution
|
|
16
17
|
- Prettier integration
|
|
17
18
|
- multiline object formatting for objects with more than three properties
|
|
@@ -80,6 +81,7 @@ The config includes:
|
|
|
80
81
|
- `@eslint-react` recommended TypeScript rules for package, workspace, Storybook, and story files
|
|
81
82
|
- `eslint-plugin-react-hooks` flat recommended rules for the same React-capable files
|
|
82
83
|
- `eslint-plugin-jest` recommended rules and Jest globals for `**/*.test.{ts,tsx}`
|
|
84
|
+
- `yaml-eslint-parser` and `eslint-plugin-yml` recommended rules for `*.yml` and `*.yaml`
|
|
83
85
|
- `eslint-plugin-storybook` flat recommended config entries
|
|
84
86
|
- `eslint-plugin-prettier` with `prettier/prettier` as a warning
|
|
85
87
|
- relaxed `@typescript-eslint/require-await` for `.bin` and `.storybook` TypeScript files
|
package/index.js
CHANGED
|
@@ -8,10 +8,26 @@ import jest from 'eslint-plugin-jest';
|
|
|
8
8
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
9
9
|
import { configs as storybookConfigs } from 'eslint-plugin-storybook';
|
|
10
10
|
import prettier from 'eslint-plugin-prettier';
|
|
11
|
+
import yml from 'eslint-plugin-yml';
|
|
12
|
+
import * as yamlParser from 'yaml-eslint-parser';
|
|
11
13
|
import eslintReact from '@eslint-react/eslint-plugin';
|
|
12
14
|
const tsEslintPlugin = tsPlugin;
|
|
13
15
|
const jestPlugin = jest;
|
|
14
16
|
const prettierPlugin = prettier;
|
|
17
|
+
const ymlPlugin = yml;
|
|
18
|
+
const ymlRecommended = yml.configs.recommended;
|
|
19
|
+
const ymlRecommendedRules = {};
|
|
20
|
+
for (const { rules } of ymlRecommended) {
|
|
21
|
+
if (!rules) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
for (const [ruleName, ruleConfig] of Object.entries(rules)) {
|
|
25
|
+
if (ruleConfig !== undefined) {
|
|
26
|
+
ymlRecommendedRules[ruleName] = ruleConfig;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const yamlEslintParser = yamlParser;
|
|
15
31
|
const storybookFlatRecommended = storybookConfigs['flat/recommended'];
|
|
16
32
|
const eslintReactRecommendedTypescript = eslintReact.configs['recommended-typescript'];
|
|
17
33
|
const reactHooksRecommended = reactHooks.configs.flat.recommended;
|
|
@@ -184,6 +200,21 @@ const config = [
|
|
|
184
200
|
...jest.configs.recommended.rules,
|
|
185
201
|
},
|
|
186
202
|
},
|
|
203
|
+
{
|
|
204
|
+
files: [
|
|
205
|
+
'*.yaml',
|
|
206
|
+
'**/*.yaml',
|
|
207
|
+
'*.yml',
|
|
208
|
+
'**/*.yml',
|
|
209
|
+
],
|
|
210
|
+
languageOptions: {
|
|
211
|
+
parser: yamlEslintParser,
|
|
212
|
+
},
|
|
213
|
+
plugins: {
|
|
214
|
+
yml: ymlPlugin,
|
|
215
|
+
},
|
|
216
|
+
rules: ymlRecommendedRules,
|
|
217
|
+
},
|
|
187
218
|
{
|
|
188
219
|
plugins: { prettier: prettierPlugin },
|
|
189
220
|
rules: {
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vyriy/eslint-config",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"description": "Shared ESLint config for Vyriy projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@eslint-react/eslint-plugin": "^5.8.
|
|
7
|
+
"@eslint-react/eslint-plugin": "^5.8.16",
|
|
8
8
|
"@eslint/js": "^10.0.1",
|
|
9
9
|
"@typescript-eslint/eslint-plugin": "^8.60.1",
|
|
10
10
|
"@typescript-eslint/parser": "^8.60.1",
|
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
"eslint-plugin-prettier": "^5.5.6",
|
|
16
16
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
17
17
|
"eslint-plugin-storybook": "^10.4.2",
|
|
18
|
+
"eslint-plugin-yml": "^3.4.0",
|
|
18
19
|
"globals": "^17.6.0",
|
|
19
20
|
"jiti": "^2.7.0",
|
|
20
21
|
"prettier": "^3.8.3",
|
|
21
|
-
"storybook": "^10.4.2"
|
|
22
|
+
"storybook": "^10.4.2",
|
|
23
|
+
"yaml-eslint-parser": "^2.0.0"
|
|
22
24
|
},
|
|
23
25
|
"agents": "./AGENTS.md",
|
|
24
26
|
"license": "MIT",
|