eslint-plugin-harlanzw 0.12.0 → 0.12.3
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/dist/index.mjs +24 -3
- package/package.json +13 -13
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import process from 'node:process';
|
|
|
4
4
|
import { TextSourceCodeBase, ConfigCommentParser, Directive, VisitNodeStep } from '@eslint/plugin-kit';
|
|
5
5
|
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
6
6
|
|
|
7
|
-
const version = "0.12.
|
|
7
|
+
const version = "0.12.3";
|
|
8
8
|
|
|
9
9
|
const STRENGTH_PATTERNS = {
|
|
10
10
|
strong: ["never", "must", "always", "under no circumstances", "absolutely", "required", "mandatory", "forbidden", "prohibited"],
|
|
@@ -3514,7 +3514,11 @@ const VUE_REACTIVITY_APIS = /* @__PURE__ */ new Set([
|
|
|
3514
3514
|
"triggerRef",
|
|
3515
3515
|
"effectScope",
|
|
3516
3516
|
"getCurrentScope",
|
|
3517
|
-
"onScopeDispose"
|
|
3517
|
+
"onScopeDispose",
|
|
3518
|
+
// Dependency injection (composition-context only)
|
|
3519
|
+
"provide",
|
|
3520
|
+
"inject",
|
|
3521
|
+
"hasInjectionContext"
|
|
3518
3522
|
]);
|
|
3519
3523
|
const VUEUSE_REACTIVITY_APIS = /* @__PURE__ */ new Set([
|
|
3520
3524
|
// Watch variants
|
|
@@ -3646,9 +3650,12 @@ function isReactivityCall(node, vueImports) {
|
|
|
3646
3650
|
return false;
|
|
3647
3651
|
}
|
|
3648
3652
|
const COMPOSABLE_RE = /^_?use[A-Z_]/;
|
|
3653
|
+
const NON_REACTIVE_COMPOSABLE_CALLS = /* @__PURE__ */ new Set([
|
|
3654
|
+
"useNuxtApp"
|
|
3655
|
+
]);
|
|
3649
3656
|
function isComposableCall(node) {
|
|
3650
3657
|
if (node.callee.type === "Identifier") {
|
|
3651
|
-
return COMPOSABLE_RE.test(node.callee.name);
|
|
3658
|
+
return COMPOSABLE_RE.test(node.callee.name) && !NON_REACTIVE_COMPOSABLE_CALLS.has(node.callee.name);
|
|
3652
3659
|
}
|
|
3653
3660
|
return false;
|
|
3654
3661
|
}
|
|
@@ -6862,6 +6869,20 @@ plugin.configs.vue = [
|
|
|
6862
6869
|
"harlanzw/vue-prefer-define-emits-object-syntax": "warn",
|
|
6863
6870
|
"harlanzw/vue-require-composable-prefix": "warn"
|
|
6864
6871
|
}
|
|
6872
|
+
},
|
|
6873
|
+
{
|
|
6874
|
+
// SFCs with two <script> blocks (one for exported types, one for setup)
|
|
6875
|
+
// confuse `import/first`: it concatenates the blocks and reports the
|
|
6876
|
+
// setup-block imports as "below the body of the module" because the
|
|
6877
|
+
// first block has exports. Autofix then corrupts the file by hoisting
|
|
6878
|
+
// imports above the exports. Disable on .vue files where the rule has
|
|
6879
|
+
// no useful signal anyway.
|
|
6880
|
+
name: "harlanzw/vue/import-first-off",
|
|
6881
|
+
files: ["**/*.vue"],
|
|
6882
|
+
ignores: CODE_IGNORES,
|
|
6883
|
+
rules: {
|
|
6884
|
+
"import/first": "off"
|
|
6885
|
+
}
|
|
6865
6886
|
}
|
|
6866
6887
|
];
|
|
6867
6888
|
plugin.configs.pnpm = [
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-harlanzw",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.12.
|
|
4
|
+
"version": "0.12.3",
|
|
5
5
|
"description": "Harlan's opinionated ESLint rules",
|
|
6
6
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -29,27 +29,27 @@
|
|
|
29
29
|
"eslint": ">=9.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@eslint/plugin-kit": "^0.
|
|
32
|
+
"@eslint/plugin-kit": "^0.7.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@antfu/eslint-config": "^
|
|
36
|
-
"@antfu/ni": "^30.
|
|
35
|
+
"@antfu/eslint-config": "^9.0.0",
|
|
36
|
+
"@antfu/ni": "^30.1.0",
|
|
37
37
|
"@antfu/utils": "^9.3.0",
|
|
38
38
|
"@types/eslint": "^9.6.1",
|
|
39
|
-
"@types/node": "^25.
|
|
40
|
-
"@typescript-eslint/typescript-estree": "^8.
|
|
41
|
-
"@typescript-eslint/utils": "^8.
|
|
42
|
-
"bumpp": "^11.0
|
|
43
|
-
"eslint": "^10.
|
|
39
|
+
"@types/node": "^25.7.0",
|
|
40
|
+
"@typescript-eslint/typescript-estree": "^8.59.3",
|
|
41
|
+
"@typescript-eslint/utils": "^8.59.3",
|
|
42
|
+
"bumpp": "^11.1.0",
|
|
43
|
+
"eslint": "^10.3.0",
|
|
44
44
|
"eslint-vitest-rule-tester": "^3.1.0",
|
|
45
45
|
"jsonc-eslint-parser": "^3.1.0",
|
|
46
46
|
"tsup": "^8.5.1",
|
|
47
47
|
"tsx": "^4.21.0",
|
|
48
|
-
"typescript": "^6.0.
|
|
48
|
+
"typescript": "^6.0.3",
|
|
49
49
|
"unbuild": "^3.6.1",
|
|
50
|
-
"vite": "^8.0.
|
|
51
|
-
"vitest": "^4.1.
|
|
52
|
-
"vue": "^3.5.
|
|
50
|
+
"vite": "^8.0.12",
|
|
51
|
+
"vitest": "^4.1.6",
|
|
52
|
+
"vue": "^3.5.34",
|
|
53
53
|
"yaml-eslint-parser": "^2.0.0"
|
|
54
54
|
},
|
|
55
55
|
"resolutions": {
|