@vheissulabs/prettier-config 1.8.0 → 1.8.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.
- package/.prettierrc +5 -0
- package/eslint.config.js +49 -39
- package/index.js +6 -6
- package/package.json +9 -21
package/.prettierrc
ADDED
package/eslint.config.js
CHANGED
|
@@ -1,52 +1,62 @@
|
|
|
1
1
|
const vue = require('eslint-plugin-vue')
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
try {
|
|
6
|
-
tseslint = require('typescript-eslint')
|
|
7
|
-
} catch (e) {
|
|
8
|
-
// typescript-eslint not installed, skip TS support
|
|
9
|
-
}
|
|
2
|
+
const tseslint = require('typescript-eslint')
|
|
3
|
+
const prettierPlugin = require('eslint-plugin-prettier')
|
|
4
|
+
const prettierConfig = require('eslint-config-prettier')
|
|
10
5
|
|
|
11
6
|
const baseConfig = [
|
|
7
|
+
// Vue recommended rules
|
|
12
8
|
...vue.configs['flat/recommended'],
|
|
9
|
+
|
|
10
|
+
// Disable ESLint rules that conflict with Prettier
|
|
11
|
+
prettierConfig,
|
|
12
|
+
|
|
13
|
+
// Run Prettier as an ESLint rule
|
|
13
14
|
{
|
|
15
|
+
plugins: {
|
|
16
|
+
prettier: prettierPlugin,
|
|
17
|
+
},
|
|
14
18
|
rules: {
|
|
15
|
-
|
|
16
|
-
'vue/singleline-html-element-content-newline': ['error', {
|
|
17
|
-
ignoreWhenNoAttributes: false,
|
|
18
|
-
ignoreWhenEmpty: true,
|
|
19
|
-
}],
|
|
20
|
-
// Force closing bracket to new line
|
|
21
|
-
'vue/html-closing-bracket-newline': ['error', {
|
|
22
|
-
singleline: 'never',
|
|
23
|
-
multiline: 'always',
|
|
24
|
-
}],
|
|
25
|
-
// Max attributes per line
|
|
26
|
-
'vue/max-attributes-per-line': ['error', {
|
|
27
|
-
singleline: 1,
|
|
28
|
-
multiline: 1,
|
|
29
|
-
}],
|
|
30
|
-
// Consistent indentation in templates
|
|
31
|
-
'vue/html-indent': ['error', 4],
|
|
32
|
-
// Disable rules that conflict with Prettier
|
|
33
|
-
'vue/html-self-closing': 'off',
|
|
34
|
-
// Allow single-word component names (common in page components)
|
|
35
|
-
'vue/multi-word-component-names': 'off',
|
|
19
|
+
'prettier/prettier': 'error',
|
|
36
20
|
},
|
|
37
21
|
},
|
|
38
22
|
]
|
|
39
23
|
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
24
|
+
// Vue-specific rules that run AFTER Prettier
|
|
25
|
+
// These fix template formatting that Prettier doesn't handle well
|
|
26
|
+
baseConfig.push({
|
|
27
|
+
rules: {
|
|
28
|
+
// Force element content to new line
|
|
29
|
+
'vue/singleline-html-element-content-newline': ['error', {
|
|
30
|
+
ignoreWhenNoAttributes: false,
|
|
31
|
+
ignoreWhenEmpty: true,
|
|
32
|
+
}],
|
|
33
|
+
// Force closing bracket to new line
|
|
34
|
+
'vue/html-closing-bracket-newline': ['error', {
|
|
35
|
+
singleline: 'never',
|
|
36
|
+
multiline: 'always',
|
|
37
|
+
}],
|
|
38
|
+
// Max attributes per line
|
|
39
|
+
'vue/max-attributes-per-line': ['error', {
|
|
40
|
+
singleline: 1,
|
|
41
|
+
multiline: 1,
|
|
42
|
+
}],
|
|
43
|
+
// Consistent indentation in templates
|
|
44
|
+
'vue/html-indent': ['error', 4],
|
|
45
|
+
// Disable rules that conflict with Prettier
|
|
46
|
+
'vue/html-self-closing': 'off',
|
|
47
|
+
// Allow single-word component names (common in page components)
|
|
48
|
+
'vue/multi-word-component-names': 'off',
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
// Add TypeScript support for Vue files
|
|
53
|
+
baseConfig.push({
|
|
54
|
+
files: ['**/*.vue'],
|
|
55
|
+
languageOptions: {
|
|
56
|
+
parserOptions: {
|
|
57
|
+
parser: tseslint.parser,
|
|
48
58
|
},
|
|
49
|
-
}
|
|
50
|
-
}
|
|
59
|
+
},
|
|
60
|
+
})
|
|
51
61
|
|
|
52
62
|
module.exports = baseConfig
|
package/index.js
CHANGED
|
@@ -8,7 +8,7 @@ module.exports = {
|
|
|
8
8
|
printWidth: 100,
|
|
9
9
|
plugins: [
|
|
10
10
|
'@trivago/prettier-plugin-sort-imports',
|
|
11
|
-
'prettier-plugin-tailwindcss'
|
|
11
|
+
'prettier-plugin-tailwindcss',
|
|
12
12
|
],
|
|
13
13
|
tailwindFunctions: ['clsx', 'cn', 'cva'],
|
|
14
14
|
importOrder: [
|
|
@@ -20,7 +20,7 @@ module.exports = {
|
|
|
20
20
|
'^@/layouts/(.*)$',
|
|
21
21
|
'^@/components/(.*)$',
|
|
22
22
|
'^@/(.*)$',
|
|
23
|
-
'^[./]'
|
|
23
|
+
'^[./]',
|
|
24
24
|
],
|
|
25
25
|
importOrderSeparation: false,
|
|
26
26
|
importOrderSortSpecifiers: true,
|
|
@@ -28,8 +28,8 @@ module.exports = {
|
|
|
28
28
|
{
|
|
29
29
|
files: '**/*.yml',
|
|
30
30
|
options: {
|
|
31
|
-
tabWidth: 2
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
]
|
|
31
|
+
tabWidth: 2,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
35
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vheissulabs/prettier-config",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "Shared Prettier and ESLint configuration for VheissuLabs projects",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
@@ -25,27 +25,15 @@
|
|
|
25
25
|
"url": "https://github.com/VheissuLabs/PrettierConfig.git"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"prettier": ">=3.0.0"
|
|
29
|
-
"prettier-plugin-tailwindcss": ">=0.5.0",
|
|
30
|
-
"eslint": ">=9.0.0",
|
|
31
|
-
"eslint-plugin-vue": ">=9.0.0",
|
|
32
|
-
"typescript-eslint": ">=8.0.0"
|
|
33
|
-
},
|
|
34
|
-
"peerDependenciesMeta": {
|
|
35
|
-
"prettier-plugin-tailwindcss": {
|
|
36
|
-
"optional": true
|
|
37
|
-
},
|
|
38
|
-
"eslint": {
|
|
39
|
-
"optional": true
|
|
40
|
-
},
|
|
41
|
-
"eslint-plugin-vue": {
|
|
42
|
-
"optional": true
|
|
43
|
-
},
|
|
44
|
-
"typescript-eslint": {
|
|
45
|
-
"optional": true
|
|
46
|
-
}
|
|
28
|
+
"prettier": ">=3.0.0"
|
|
47
29
|
},
|
|
48
30
|
"dependencies": {
|
|
49
|
-
"@trivago/prettier-plugin-sort-imports": "^5.0.0"
|
|
31
|
+
"@trivago/prettier-plugin-sort-imports": "^5.0.0",
|
|
32
|
+
"prettier-plugin-tailwindcss": "^0.6.0",
|
|
33
|
+
"eslint": "^9.0.0",
|
|
34
|
+
"eslint-plugin-vue": "^9.0.0",
|
|
35
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
36
|
+
"eslint-config-prettier": "^9.0.0",
|
|
37
|
+
"typescript-eslint": "^8.0.0"
|
|
50
38
|
}
|
|
51
39
|
}
|