@danielwaltz/eslint-config 2.3.1 → 2.4.0
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/CHANGELOG.md +17 -0
- package/dist/index.d.mts +18 -14
- package/dist/index.mjs +122 -127
- package/package.json +10 -10
- package/dist/index.d.ts +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## v2.4.0
|
|
5
|
+
|
|
6
|
+
[compare changes](https://github.com/danielwaltz/eslint-config/compare/v2.3.1...v2.4.0)
|
|
7
|
+
|
|
8
|
+
### 🚀 Enhancements
|
|
9
|
+
|
|
10
|
+
- Update sxzz config ([cb76e3e](https://github.com/danielwaltz/eslint-config/commit/cb76e3e))
|
|
11
|
+
|
|
12
|
+
### 🏡 Chore
|
|
13
|
+
|
|
14
|
+
- Approve local builds ([78a36c4](https://github.com/danielwaltz/eslint-config/commit/78a36c4))
|
|
15
|
+
- Migrate from `unbuild` to `obuild` ([a765b63](https://github.com/danielwaltz/eslint-config/commit/a765b63))
|
|
16
|
+
|
|
17
|
+
### ❤️ Contributors
|
|
18
|
+
|
|
19
|
+
- Daniel Waltz ([@danielwaltz](https://github.com/danielwaltz))
|
|
20
|
+
|
|
4
21
|
## v2.3.1
|
|
5
22
|
|
|
6
23
|
[compare changes](https://github.com/danielwaltz/eslint-config/compare/v2.3.0...v2.3.1)
|
package/dist/index.d.mts
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
import { sxzz } from "@sxzz/eslint-config";
|
|
2
|
+
import * as eslint_flat_config_utils9 from "eslint-flat-config-utils";
|
|
3
|
+
import * as eslint_flat_config_utils4 from "eslint-flat-config-utils";
|
|
4
|
+
import { DefaultConfigNamesMap, DefaultConfigNamesMap as DefaultConfigNamesMap$1, ResolvableFlatConfig, defineFlatConfig } from "eslint-flat-config-utils";
|
|
5
|
+
import * as eslint5 from "eslint";
|
|
6
|
+
import * as eslint0 from "eslint";
|
|
7
|
+
import { Linter } from "eslint";
|
|
8
|
+
export * from "@sxzz/eslint-config";
|
|
8
9
|
|
|
10
|
+
//#region src/types.d.ts
|
|
9
11
|
type BaseConfig = Linter.Config;
|
|
10
|
-
type BaseConfigNames = keyof DefaultConfigNamesMap;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
type BaseConfigNames = keyof DefaultConfigNamesMap$1;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/utils.d.ts
|
|
15
|
+
declare function defineFlatConfigs<const TConfig extends BaseConfig = BaseConfig, const TConfigNames extends string = BaseConfigNames>(...configs: ResolvableFlatConfig<TConfig>[]): eslint_flat_config_utils9.FlatConfigComposer<eslint5.Linter.Config<eslint5.Linter.RulesRecord> extends TConfig ? TConfig : eslint5.Linter.Config<eslint5.Linter.RulesRecord>, TConfigNames>;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/index.d.ts
|
|
18
|
+
declare function danielwaltz<const TConfig extends BaseConfig = BaseConfig, const TConfigNames extends string = BaseConfigNames>(...params: Parameters<typeof sxzz>): eslint_flat_config_utils4.FlatConfigComposer<eslint0.Linter.Config<eslint0.Linter.RulesRecord> extends TConfig ? TConfig : eslint0.Linter.Config<eslint0.Linter.RulesRecord>, TConfigNames>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { DefaultConfigNamesMap, danielwaltz, defineFlatConfig, defineFlatConfigs };
|
package/dist/index.mjs
CHANGED
|
@@ -1,143 +1,138 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { composer } from 'eslint-flat-config-utils';
|
|
6
|
-
export { defineFlatConfig } from 'eslint-flat-config-utils';
|
|
1
|
+
import { hasVue, sxzz } from "@sxzz/eslint-config";
|
|
2
|
+
import erasableSyntaxOnlyPlugin from "eslint-plugin-erasable-syntax-only";
|
|
3
|
+
import vueA11yPlugin from "eslint-plugin-vuejs-accessibility";
|
|
4
|
+
import { composer, defineFlatConfig } from "eslint-flat-config-utils";
|
|
7
5
|
|
|
6
|
+
export * from "@sxzz/eslint-config"
|
|
7
|
+
|
|
8
|
+
//#region src/configs/typescript.ts
|
|
8
9
|
function typescriptConfigs() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
];
|
|
10
|
+
return [{
|
|
11
|
+
name: "danielwaltz/erasable-syntax-only",
|
|
12
|
+
...erasableSyntaxOnlyPlugin.configs.recommended
|
|
13
|
+
}];
|
|
15
14
|
}
|
|
16
15
|
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/configs/unicorn.ts
|
|
17
18
|
function unicornConfigs() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
];
|
|
19
|
+
return [{
|
|
20
|
+
name: "danielwaltz/unicorn",
|
|
21
|
+
rules: { "unicorn/filename-case": ["error", {
|
|
22
|
+
cases: {
|
|
23
|
+
camelCase: true,
|
|
24
|
+
kebabCase: true,
|
|
25
|
+
pascalCase: true
|
|
26
|
+
},
|
|
27
|
+
ignore: [/^[A-Z]+\..*$/, /import_map\.json/]
|
|
28
|
+
}] }
|
|
29
|
+
}];
|
|
32
30
|
}
|
|
33
31
|
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/configs/vue.ts
|
|
34
34
|
function vueConfigs() {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"error",
|
|
119
|
-
{ img: ["AppImg", "BaseImg", "NuxtImg"] }
|
|
120
|
-
],
|
|
121
|
-
"vuejs-accessibility/anchor-has-content": [
|
|
122
|
-
"error",
|
|
123
|
-
{ components: ["AppLink", "BaseLink", "NuxtLink"] }
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
];
|
|
35
|
+
return [...vueA11yPlugin.configs["flat/recommended"], {
|
|
36
|
+
name: "danielwaltz/vue",
|
|
37
|
+
files: ["**/*.vue"],
|
|
38
|
+
rules: {
|
|
39
|
+
"vue/block-lang": ["error", { script: { lang: ["ts", "tsx"] } }],
|
|
40
|
+
"vue/block-order": ["error", { order: [
|
|
41
|
+
"script",
|
|
42
|
+
"template",
|
|
43
|
+
"style"
|
|
44
|
+
] }],
|
|
45
|
+
"vue/block-tag-newline": "error",
|
|
46
|
+
"vue/component-api-style": ["error", ["script-setup"]],
|
|
47
|
+
"vue/component-name-in-template-casing": "error",
|
|
48
|
+
"vue/component-options-name-casing": "error",
|
|
49
|
+
"vue/custom-event-name-casing": "error",
|
|
50
|
+
"vue/define-emits-declaration": ["error", "type-based"],
|
|
51
|
+
"vue/define-macros-order": ["error", {
|
|
52
|
+
order: [
|
|
53
|
+
"definePageMeta",
|
|
54
|
+
"defineOptions",
|
|
55
|
+
"defineModal",
|
|
56
|
+
"defineProps",
|
|
57
|
+
"defineEmits",
|
|
58
|
+
"defineSlots"
|
|
59
|
+
],
|
|
60
|
+
defineExposeLast: true
|
|
61
|
+
}],
|
|
62
|
+
"vue/define-props-declaration": ["error", "type-based"],
|
|
63
|
+
"vue/enforce-style-attribute": ["error", { allow: ["scoped"] }],
|
|
64
|
+
"vue/html-button-has-type": "error",
|
|
65
|
+
"vue/html-comment-content-newline": "error",
|
|
66
|
+
"vue/html-comment-content-spacing": "error",
|
|
67
|
+
"vue/html-comment-indent": "error",
|
|
68
|
+
"vue/match-component-file-name": ["error", { extensions: ["vue", "tsx"] }],
|
|
69
|
+
"vue/match-component-import-name": "error",
|
|
70
|
+
"vue/next-tick-style": ["error", "promise"],
|
|
71
|
+
"vue/no-boolean-default": "error",
|
|
72
|
+
"vue/no-duplicate-attr-inheritance": "error",
|
|
73
|
+
"vue/no-empty-component-block": "error",
|
|
74
|
+
"vue/no-import-compiler-macros": "error",
|
|
75
|
+
"vue/no-multiple-objects-in-class": "error",
|
|
76
|
+
"vue/no-ref-object-reactivity-loss": "error",
|
|
77
|
+
"vue/no-required-prop-with-default": ["error", { autofix: true }],
|
|
78
|
+
"vue/no-reserved-component-names": "error",
|
|
79
|
+
"vue/no-root-v-if": "error",
|
|
80
|
+
"vue/no-template-target-blank": "error",
|
|
81
|
+
"vue/no-unsupported-features": ["error", { version: "^3.5.0" }],
|
|
82
|
+
"vue/no-unused-emit-declarations": "error",
|
|
83
|
+
"vue/no-unused-properties": "error",
|
|
84
|
+
"vue/no-unused-refs": "error",
|
|
85
|
+
"vue/no-use-v-else-with-v-for": "error",
|
|
86
|
+
"vue/no-useless-mustaches": "error",
|
|
87
|
+
"vue/no-useless-v-bind": "error",
|
|
88
|
+
"vue/no-v-text": "error",
|
|
89
|
+
"vue/padding-line-between-blocks": "error",
|
|
90
|
+
"vue/prefer-define-options": "error",
|
|
91
|
+
"vue/prefer-prop-type-boolean-first": "error",
|
|
92
|
+
"vue/prefer-separate-static-class": "error",
|
|
93
|
+
"vue/prefer-true-attribute-shorthand": "error",
|
|
94
|
+
"vue/prefer-use-template-ref": "error",
|
|
95
|
+
"vue/require-direct-export": "error",
|
|
96
|
+
"vue/require-macro-variable-name": "error",
|
|
97
|
+
"vue/require-name-property": "error",
|
|
98
|
+
"vue/require-typed-ref": "error",
|
|
99
|
+
"vue/slot-name-casing": "error",
|
|
100
|
+
"vue/v-bind-style": [
|
|
101
|
+
"error",
|
|
102
|
+
"shorthand",
|
|
103
|
+
{ sameNameShorthand: "always" }
|
|
104
|
+
],
|
|
105
|
+
"vue/v-for-delimiter-style": "error",
|
|
106
|
+
"vuejs-accessibility/alt-text": ["error", { img: [
|
|
107
|
+
"AppImg",
|
|
108
|
+
"BaseImg",
|
|
109
|
+
"NuxtImg"
|
|
110
|
+
] }],
|
|
111
|
+
"vuejs-accessibility/anchor-has-content": ["error", { components: [
|
|
112
|
+
"AppLink",
|
|
113
|
+
"BaseLink",
|
|
114
|
+
"NuxtLink"
|
|
115
|
+
] }]
|
|
116
|
+
}
|
|
117
|
+
}];
|
|
128
118
|
}
|
|
129
119
|
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/utils.ts
|
|
130
122
|
function defineFlatConfigs(...configs) {
|
|
131
|
-
|
|
123
|
+
return composer(...configs);
|
|
132
124
|
}
|
|
133
125
|
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/index.ts
|
|
134
128
|
function danielwaltz(...params) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
129
|
+
const composer$1 = defineFlatConfigs();
|
|
130
|
+
composer$1.prepend(sxzz(...params));
|
|
131
|
+
composer$1.append(typescriptConfigs());
|
|
132
|
+
composer$1.append(unicornConfigs());
|
|
133
|
+
if (hasVue()) composer$1.append(vueConfigs());
|
|
134
|
+
return composer$1;
|
|
141
135
|
}
|
|
142
136
|
|
|
143
|
-
|
|
137
|
+
//#endregion
|
|
138
|
+
export { danielwaltz, defineFlatConfig, defineFlatConfigs };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielwaltz/eslint-config",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"packageManager": "pnpm@10.
|
|
3
|
+
"version": "2.4.0",
|
|
4
|
+
"packageManager": "pnpm@10.11.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"eslint-config"
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
|
-
"build": "
|
|
31
|
-
"stub": "
|
|
30
|
+
"build": "obuild",
|
|
31
|
+
"stub": "obuild --stub",
|
|
32
32
|
"lint": "eslint",
|
|
33
33
|
"type-check": "tsc --noEmit",
|
|
34
34
|
"prepack": "pnpm build",
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
"prettier": ">=3"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@sxzz/eslint-config": "^
|
|
44
|
-
"eslint-flat-config-utils": "^2.0
|
|
43
|
+
"@sxzz/eslint-config": "^7.0.1",
|
|
44
|
+
"eslint-flat-config-utils": "^2.1.0",
|
|
45
45
|
"eslint-plugin-erasable-syntax-only": "^0.3.1",
|
|
46
46
|
"eslint-plugin-vuejs-accessibility": "^2.4.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@tsconfig/node22": "^22.0.
|
|
50
|
-
"@types/node": "~22.15.
|
|
49
|
+
"@tsconfig/node22": "^22.0.2",
|
|
50
|
+
"@types/node": "~22.15.29",
|
|
51
51
|
"changelogen": "^0.6.1",
|
|
52
|
-
"
|
|
53
|
-
"
|
|
52
|
+
"obuild": "^0.2.1",
|
|
53
|
+
"typescript": "~5.8.3"
|
|
54
54
|
}
|
|
55
55
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as eslint_flat_config_utils from 'eslint-flat-config-utils';
|
|
2
|
-
import { DefaultConfigNamesMap, ResolvableFlatConfig } from 'eslint-flat-config-utils';
|
|
3
|
-
export { DefaultConfigNamesMap, defineFlatConfig } from 'eslint-flat-config-utils';
|
|
4
|
-
import * as eslint from 'eslint';
|
|
5
|
-
import { Linter } from 'eslint';
|
|
6
|
-
import { sxzz } from '@sxzz/eslint-config';
|
|
7
|
-
export * from '@sxzz/eslint-config';
|
|
8
|
-
|
|
9
|
-
type BaseConfig = Linter.Config;
|
|
10
|
-
type BaseConfigNames = keyof DefaultConfigNamesMap;
|
|
11
|
-
|
|
12
|
-
declare function defineFlatConfigs<const TConfig extends BaseConfig = BaseConfig, const TConfigNames extends string = BaseConfigNames>(...configs: ResolvableFlatConfig<TConfig>[]): eslint_flat_config_utils.FlatConfigComposer<eslint.Linter.Config<eslint.Linter.RulesRecord> extends TConfig ? TConfig : eslint.Linter.Config<eslint.Linter.RulesRecord>, TConfigNames>;
|
|
13
|
-
|
|
14
|
-
declare function danielwaltz<const TConfig extends BaseConfig = BaseConfig, const TConfigNames extends string = BaseConfigNames>(...params: Parameters<typeof sxzz>): eslint_flat_config_utils.FlatConfigComposer<eslint.Linter.Config<eslint.Linter.RulesRecord> extends TConfig ? TConfig : eslint.Linter.Config<eslint.Linter.RulesRecord>, TConfigNames>;
|
|
15
|
-
|
|
16
|
-
export { danielwaltz, defineFlatConfigs };
|