vue-linters-config 0.3.5 → 0.3.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 +51 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Конфиги eslint
|
|
1
|
+
# Конфиги eslint, stylelint, prettier
|
|
2
2
|
|
|
3
3
|
[npm](https://www.npmjs.com/package/vue-linters-config)
|
|
4
4
|
|
|
@@ -14,7 +14,7 @@ _Легко принимать свободу как должное, если н
|
|
|
14
14
|
|
|
15
15
|
Установка сторонних зависимостей:
|
|
16
16
|
|
|
17
|
-
`npm i eslint eslint-config-prettier eslint-import-resolver-typescript postcss-html prettier stylelint stylelint-config-recess-order stylelint-config-recommended-scss stylelint-config-recommended-vue stylelint-prettier --save-dev`
|
|
17
|
+
`npm i eslint @eslint/js typescript-eslint eslint-plugin-vue vue-eslint-parser eslint-plugin-import-x eslint-plugin-prettier globals eslint-config-prettier eslint-import-resolver-typescript postcss-html prettier stylelint stylelint-config-recess-order stylelint-config-recommended-scss stylelint-config-recommended-vue stylelint-prettier --save-dev`
|
|
18
18
|
|
|
19
19
|
В package.json добавить команду в секцию script для запуска npm run lint:
|
|
20
20
|
|
|
@@ -27,20 +27,63 @@ _Легко принимать свободу как должное, если н
|
|
|
27
27
|
eslint.config.js:
|
|
28
28
|
|
|
29
29
|
```
|
|
30
|
-
import
|
|
31
|
-
|
|
30
|
+
import js from '@eslint/js';
|
|
31
|
+
import tseslint from 'typescript-eslint';
|
|
32
|
+
import pluginVue from 'eslint-plugin-vue';
|
|
33
|
+
import vueParser from 'vue-eslint-parser';
|
|
34
|
+
import eslintPluginImportX from 'eslint-plugin-import-x';
|
|
35
|
+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
36
|
+
import globals from 'globals';
|
|
37
|
+
import { ignores, settings, rules } from 'vue-linters-config';
|
|
38
|
+
|
|
39
|
+
export default tseslint.config(
|
|
40
|
+
js.configs.recommended,
|
|
41
|
+
...tseslint.configs.recommended,
|
|
42
|
+
...pluginVue.configs['flat/strongly-recommended'],
|
|
43
|
+
eslintPluginImportX.flatConfigs.recommended,
|
|
44
|
+
eslintPluginImportX.flatConfigs.typescript,
|
|
45
|
+
|
|
46
|
+
ignores,
|
|
47
|
+
|
|
48
|
+
{
|
|
49
|
+
files: ['**/*.{ts,tsx,vue}'],
|
|
50
|
+
languageOptions: { parser: tseslint.parser },
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
files: ['**/*.vue'],
|
|
54
|
+
languageOptions: { parser: vueParser, parserOptions: { parser: tseslint.parser } },
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
{
|
|
58
|
+
languageOptions: {
|
|
59
|
+
ecmaVersion: 2022,
|
|
60
|
+
sourceType: 'module',
|
|
61
|
+
globals: { ...globals.browser, ...globals.node, ymaps: 'writable' },
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
...settings,
|
|
65
|
+
...rules,
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
eslintPluginPrettierRecommended
|
|
69
|
+
);
|
|
70
|
+
|
|
32
71
|
```
|
|
33
72
|
|
|
34
73
|
prettier.config.js:
|
|
35
74
|
|
|
36
75
|
```
|
|
37
|
-
import { prettier } from
|
|
38
|
-
|
|
76
|
+
import { prettier } from 'vue-linters-config';
|
|
77
|
+
|
|
78
|
+
export default prettier;
|
|
79
|
+
|
|
39
80
|
```
|
|
40
81
|
|
|
41
82
|
stylelint.config.js:
|
|
42
83
|
|
|
43
84
|
```
|
|
44
|
-
import { stylelint } from
|
|
45
|
-
|
|
85
|
+
import { stylelint } from 'vue-linters-config';
|
|
86
|
+
|
|
87
|
+
export default stylelint;
|
|
88
|
+
|
|
46
89
|
```
|