eco-vue-js 0.11.31 → 0.11.32
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.
@@ -0,0 +1,23 @@
|
|
1
|
+
import {parser as tsParser} from 'typescript-eslint'
|
2
|
+
|
3
|
+
export default (astroParser) => [
|
4
|
+
{
|
5
|
+
files: ['**/*.astro'],
|
6
|
+
languageOptions: {
|
7
|
+
parser: astroParser,
|
8
|
+
parserOptions: {
|
9
|
+
parser: tsParser,
|
10
|
+
extraFileExtensions: ['.astro'],
|
11
|
+
},
|
12
|
+
},
|
13
|
+
rules: {
|
14
|
+
'import/default': 'off',
|
15
|
+
'import/no-named-as-default': 'off',
|
16
|
+
'import/no-named-as-default-member': 'off',
|
17
|
+
'import/named': 'off',
|
18
|
+
'import/namespace': 'off',
|
19
|
+
indent: 'off',
|
20
|
+
'@stylistic/indent': 'off',
|
21
|
+
},
|
22
|
+
},
|
23
|
+
]
|
@@ -2,12 +2,12 @@ import importPlugin from 'eslint-plugin-import'
|
|
2
2
|
|
3
3
|
import {readFileSync} from 'fs'
|
4
4
|
|
5
|
-
const createConfig = (tsConfig) => {
|
5
|
+
const createConfig = (tsConfig, astro = false) => {
|
6
6
|
const file = readFileSync(tsConfig, 'utf-8')
|
7
7
|
const parsed = JSON.parse(file)
|
8
8
|
|
9
9
|
return {
|
10
|
-
files: parsed.include ?? ['**/*.{ts,js,vue}'],
|
10
|
+
files: parsed.include ?? (astro ? ['**/*.{ts,js,vue,astro}'] : ['**/*.{ts,js,vue}']),
|
11
11
|
plugins: {
|
12
12
|
import: importPlugin,
|
13
13
|
},
|
@@ -51,14 +51,19 @@ const createConfig = (tsConfig) => {
|
|
51
51
|
}
|
52
52
|
}
|
53
53
|
|
54
|
-
export default ({tsConfig = './tsconfig.json'}) => [
|
54
|
+
export default ({tsConfig = './tsconfig.json', astro = false}) => [
|
55
55
|
{
|
56
|
-
files: ['**/*.{ts,js,vue}'],
|
56
|
+
files: astro ? ['**/*.{ts,js,vue,astro}'] : ['**/*.{ts,js,vue}'],
|
57
57
|
plugins: {
|
58
58
|
import: importPlugin,
|
59
59
|
},
|
60
60
|
rules: {
|
61
61
|
...importPlugin.flatConfigs.recommended.rules,
|
62
|
+
...(astro ? {
|
63
|
+
'import/named': 'off',
|
64
|
+
'import/namespace': 'off',
|
65
|
+
'import/default': 'off',
|
66
|
+
} : {}),
|
62
67
|
'import/order': [
|
63
68
|
1,
|
64
69
|
{
|
@@ -84,5 +89,5 @@ export default ({tsConfig = './tsconfig.json'}) => [
|
|
84
89
|
},
|
85
90
|
},
|
86
91
|
|
87
|
-
...(Array.isArray(tsConfig) ? tsConfig : [tsConfig]).map(createConfig),
|
92
|
+
...(Array.isArray(tsConfig) ? tsConfig : [tsConfig]).map(cfg => createConfig(cfg, astro)),
|
88
93
|
]
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import tailwind from 'eslint-plugin-tailwindcss'
|
2
2
|
|
3
|
-
export default [
|
3
|
+
export default (config = {}) => [
|
4
4
|
...tailwind.configs['flat/recommended'],
|
5
5
|
|
6
6
|
{
|
7
|
-
files: ['**/*.{ts,js,vue}'],
|
7
|
+
files: config.astro ? ['**/*.{ts,js,vue,astro}'] : ['**/*.{ts,js,vue}'],
|
8
8
|
rules: {
|
9
9
|
'tailwindcss/no-custom-classname': 'off',
|
10
10
|
'tailwindcss/migration-from-tailwind-2': 'off',
|
@@ -3,9 +3,9 @@ import unusedImports from 'eslint-plugin-unused-imports'
|
|
3
3
|
import pluginVue from 'eslint-plugin-vue'
|
4
4
|
import {parser as tseslintParser, plugin as tseslintPlugin} from 'typescript-eslint'
|
5
5
|
|
6
|
-
export default [
|
6
|
+
export default (config = {}) => [
|
7
7
|
{
|
8
|
-
files: ['**/*.{ts,js,vue}'],
|
8
|
+
files: config.astro ? ['**/*.{ts,js,vue,astro}'] : ['**/*.{ts,js,vue}'],
|
9
9
|
plugins: {
|
10
10
|
'unused-imports': unusedImports,
|
11
11
|
'@stylistic': stylistic,
|
package/eslint/recommended.js
CHANGED
@@ -5,6 +5,7 @@ import {
|
|
5
5
|
} from '@vue/eslint-config-typescript'
|
6
6
|
import pluginVue from 'eslint-plugin-vue'
|
7
7
|
|
8
|
+
import configAstro from './configs/configAstro.js'
|
8
9
|
import configImports from './configs/configImports.js'
|
9
10
|
import configJson from './configs/configJson.js'
|
10
11
|
import configSvgo from './configs/configSvgo.js'
|
@@ -19,12 +20,14 @@ export default (config = {}) => [
|
|
19
20
|
).map(item => ({...item, files: ['**/*.{ts,tsx,vue}']})),
|
20
21
|
|
21
22
|
...config.noVue ? [] : configVue,
|
22
|
-
|
23
|
+
|
23
24
|
...pluginQuery.configs['flat/recommended'],
|
24
25
|
|
25
26
|
...configJson,
|
26
|
-
...configTypescript,
|
27
|
-
...configTailwind,
|
27
|
+
...configTypescript(config),
|
28
|
+
...configTailwind(config),
|
28
29
|
...configImports(config),
|
29
30
|
...configSvgo,
|
31
|
+
|
32
|
+
...config.astro ? configAstro(config.astro) : [],
|
30
33
|
]
|