@alexlit/lint-kit 167.2.0 → 167.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/package.json +1 -1
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/LICENSE +21 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/README.md +54 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/base.d.ts +23 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/base.js +25 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/flat/base.d.ts +35 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/flat/base.js +35 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/flat/recommended.d.ts +1194 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/flat/recommended.js +39 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/recommended.d.ts +29 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/recommended.js +29 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/index.d.ts +2532 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/index.js +62 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/key-format-style.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/key-format-style.js +247 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-component.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-component.js +85 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-place-attr.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-place-attr.js +41 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-places-prop.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-places-prop.js +36 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-modulo-syntax.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-modulo-syntax.js +94 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-tc.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-tc.js +42 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-v-t.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-v-t.js +33 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-duplicate-keys-in-locale.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-duplicate-keys-in-locale.js +271 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-dynamic-keys.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-dynamic-keys.js +105 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-html-messages.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-html-messages.js +137 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-i18n-t-path-prop.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-i18n-t-path-prop.js +44 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-missing-keys-in-other-locales.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-missing-keys-in-other-locales.js +264 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-missing-keys.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-missing-keys.js +111 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-raw-text.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-raw-text.js +575 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-unknown-locale.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-unknown-locale.js +198 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-unused-keys.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-unused-keys.js +456 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-v-html.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-v-html.js +50 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/prefer-linked-key-with-paren.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/prefer-linked-key-with-paren.js +108 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/prefer-sfc-lang-attr.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/prefer-sfc-lang-attr.js +58 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/sfc-locale-attr.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/sfc-locale-attr.js +65 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/valid-message-syntax.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/valid-message-syntax.js +186 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/eslint.d.ts +216 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/eslint.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/i18n.d.ts +5 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/i18n.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/index.d.ts +6 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/index.js +22 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/nodes.d.ts +7 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/nodes.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/settings.d.ts +8 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/settings.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/types.d.ts +38 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/types.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/vue-parser-services.d.ts +32 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/vue-parser-services.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/cache-function.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/cache-function.js +11 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/cache-loader.d.ts +10 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/cache-loader.js +27 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/casing.d.ts +10 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/casing.js +101 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/collect-keys.d.ts +13 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/collect-keys.js +160 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/collect-linked-keys.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/collect-linked-keys.js +49 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/compat.d.ts +3 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/compat.js +35 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/default-timeouts.d.ts +6 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/default-timeouts.js +10 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/get-cwd.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/get-cwd.js +9 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/glob-utils.d.ts +15 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/glob-utils.js +154 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/ignored-paths.d.ts +43 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/ignored-paths.js +234 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/index.d.ts +25 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/index.js +446 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/key-path.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/key-path.js +27 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/locale-messages.d.ts +54 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/locale-messages.js +187 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/parser-v9.d.ts +8 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/parser-v9.js +40 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/parser.d.ts +5 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/parser.js +18 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/traverser.d.ts +6 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/traverser.js +31 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/utils.d.ts +28 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/utils.js +279 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/build-parser-using-flat-config.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/build-parser-using-flat-config.js +11 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/build-parser-using-legacy-config.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/build-parser-using-legacy-config.js +46 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/index.d.ts +4 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/index.js +18 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/parse-by-parser.d.ts +3 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/parse-by-parser.js +42 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/should-use-flat-config.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/should-use-flat-config.js +54 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/worker.d.ts +1 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/worker.js +32 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parsers/index.d.ts +4 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parsers/index.js +32 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/path-utils.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/path-utils.js +21 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/regexp.d.ts +1 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/regexp.js +16 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/resource-loader.d.ts +10 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/resource-loader.js +32 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/rule.d.ts +9 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/rule.js +75 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/globals.json +3345 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/index.d.ts +3452 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/index.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/license +9 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/package.json +117 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/readme.md +42 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/package.json +147 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/LICENSE +21 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/README.md +332 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/index.d.ts +667 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/index.js +6642 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/index.js.map +1 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/package.json +100 -0
- package/packages/config-eslint/package.json +5 -5
- package/packages/config-eslint/plugins/unicorn.js +2 -0
- package/packages/config-prettier/package.json +3 -3
- package/packages/config-stylelint/package.json +3 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "globals",
|
|
3
|
+
"version": "16.5.0",
|
|
4
|
+
"description": "Global identifiers from different JavaScript environments",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/globals",
|
|
7
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sindre Sorhus",
|
|
10
|
+
"email": "sindresorhus@gmail.com",
|
|
11
|
+
"url": "https://sindresorhus.com"
|
|
12
|
+
},
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=18"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"test": "npm run build && xo && ava && tsd",
|
|
19
|
+
"prepare": "npm run build",
|
|
20
|
+
"update": "node scripts/update.mjs",
|
|
21
|
+
"update:browser": "node scripts/update.mjs --job=browser",
|
|
22
|
+
"update:builtin": "node scripts/update.mjs --job=builtin",
|
|
23
|
+
"update:builtin-yearly": "node scripts/update.mjs --job=builtin-yearly",
|
|
24
|
+
"update:nodeBuiltin": "node scripts/update.mjs --job=nodeBuiltin",
|
|
25
|
+
"update:worker": "node scripts/update.mjs --job=worker",
|
|
26
|
+
"update:serviceworker": "node scripts/update.mjs --job=serviceworker",
|
|
27
|
+
"update:shelljs": "node scripts/update.mjs --job=shelljs",
|
|
28
|
+
"update:jest": "node scripts/update.mjs --job=jest",
|
|
29
|
+
"update:vitest": "node scripts/update.mjs --job=vitest",
|
|
30
|
+
"build": "run-s build:data build:types",
|
|
31
|
+
"build:data": "node scripts/generate-data.mjs",
|
|
32
|
+
"build:types": "node scripts/generate-types.mjs"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"index.js",
|
|
36
|
+
"index.d.ts",
|
|
37
|
+
"globals.json"
|
|
38
|
+
],
|
|
39
|
+
"keywords": [
|
|
40
|
+
"globals",
|
|
41
|
+
"global",
|
|
42
|
+
"identifiers",
|
|
43
|
+
"variables",
|
|
44
|
+
"vars",
|
|
45
|
+
"jshint",
|
|
46
|
+
"eslint",
|
|
47
|
+
"environments"
|
|
48
|
+
],
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@vitest/eslint-plugin": "^1.1.44",
|
|
51
|
+
"ava": "^6.3.0",
|
|
52
|
+
"cheerio": "^1.0.0",
|
|
53
|
+
"eslint-plugin-jest": "^28.11.0",
|
|
54
|
+
"get-port": "^7.1.0",
|
|
55
|
+
"is-identifier": "^1.0.1",
|
|
56
|
+
"nano-spawn": "^0.2.0",
|
|
57
|
+
"npm-run-all2": "^8.0.1",
|
|
58
|
+
"outdent": "^0.8.0",
|
|
59
|
+
"puppeteer": "^24.27.0",
|
|
60
|
+
"shelljs": "^0.9.2",
|
|
61
|
+
"tsd": "^0.32.0",
|
|
62
|
+
"type-fest": "^4.41.0",
|
|
63
|
+
"xo": "^0.60.0"
|
|
64
|
+
},
|
|
65
|
+
"xo": {
|
|
66
|
+
"rules": {
|
|
67
|
+
"unicorn/prefer-module": "off"
|
|
68
|
+
},
|
|
69
|
+
"overrides": [
|
|
70
|
+
{
|
|
71
|
+
"files": [
|
|
72
|
+
"data/*.mjs"
|
|
73
|
+
],
|
|
74
|
+
"rules": {
|
|
75
|
+
"import/no-anonymous-default-export": "off",
|
|
76
|
+
"camelcase": "off",
|
|
77
|
+
"unicorn/filename-case": [
|
|
78
|
+
"error",
|
|
79
|
+
{
|
|
80
|
+
"cases": {
|
|
81
|
+
"camelCase": true,
|
|
82
|
+
"kebabCase": true
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"files": [
|
|
90
|
+
"scripts/*.mjs"
|
|
91
|
+
],
|
|
92
|
+
"rules": {
|
|
93
|
+
"n/no-unsupported-features/node-builtins": "off"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"files": [
|
|
98
|
+
"scripts/browser/assets/**/*.mjs"
|
|
99
|
+
],
|
|
100
|
+
"envs": [
|
|
101
|
+
"browser",
|
|
102
|
+
"worker",
|
|
103
|
+
"serviceworker"
|
|
104
|
+
],
|
|
105
|
+
"rules": {
|
|
106
|
+
"n/no-unsupported-features/node-builtins": "off",
|
|
107
|
+
"unicorn/prefer-add-event-listener": "off"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"tsd": {
|
|
113
|
+
"compilerOptions": {
|
|
114
|
+
"resolveJsonModule": true
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# globals
|
|
2
|
+
|
|
3
|
+
> Global identifiers from different JavaScript environments
|
|
4
|
+
|
|
5
|
+
It's just a [JSON file](globals.json), so you can use it in any environment.
|
|
6
|
+
|
|
7
|
+
This package is used by ESLint 8 and earlier. For ESLint 9 and later, you should depend on this package directly in [your ESLint config](https://eslint.org/docs/latest/use/configure/language-options#predefined-global-variables).
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install globals
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import globals from 'globals';
|
|
19
|
+
|
|
20
|
+
console.log(globals.browser);
|
|
21
|
+
/*
|
|
22
|
+
{
|
|
23
|
+
addEventListener: false,
|
|
24
|
+
applicationCache: false,
|
|
25
|
+
ArrayBuffer: false,
|
|
26
|
+
atob: false,
|
|
27
|
+
…
|
|
28
|
+
}
|
|
29
|
+
*/
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Each global is given a value of `true` or `false`. A value of `true` indicates that the variable may be overwritten. A value of `false` indicates that the variable should be considered read-only. This information is used by static analysis tools to flag incorrect behavior. We assume all variables should be `false` unless we hear otherwise.
|
|
33
|
+
|
|
34
|
+
For Node.js this package provides two sets of globals:
|
|
35
|
+
|
|
36
|
+
- `globals.nodeBuiltin`: Globals available to all code running in Node.js.
|
|
37
|
+
These will usually be available as properties on the `globalThis` object and include `process`, `Buffer`, but not CommonJS arguments like `require`.
|
|
38
|
+
See: https://nodejs.org/api/globals.html
|
|
39
|
+
- `globals.node`: A combination of the globals from `nodeBuiltin` plus all CommonJS arguments ("CommonJS module scope").
|
|
40
|
+
See: https://nodejs.org/api/modules.html#modules_the_module_scope
|
|
41
|
+
|
|
42
|
+
When analyzing code that is known to run outside of a CommonJS wrapper, for example, JavaScript modules, `nodeBuiltin` can find accidental CommonJS references.
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@intlify/eslint-plugin-vue-i18n",
|
|
3
|
+
"description": "ESLint plugin for Vue I18n",
|
|
4
|
+
"version": "4.1.1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/intlify/eslint-plugin-vue-i18n#readme",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"eslint",
|
|
9
|
+
"eslint-plugin",
|
|
10
|
+
"eslintplugin",
|
|
11
|
+
"i18n",
|
|
12
|
+
"internationalization",
|
|
13
|
+
"vue",
|
|
14
|
+
"vue-i18n",
|
|
15
|
+
"vue.js",
|
|
16
|
+
"vuejs"
|
|
17
|
+
],
|
|
18
|
+
"author": {
|
|
19
|
+
"name": "kazuya kawaguchi",
|
|
20
|
+
"email": "kawakazu80@gmail.com"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/intlify/eslint-plugin-vue-i18n.git"
|
|
25
|
+
},
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/intlify/eslint-plugin-vue-i18n/issues"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18.0.0"
|
|
31
|
+
},
|
|
32
|
+
"type": "commonjs",
|
|
33
|
+
"files": [
|
|
34
|
+
"dist"
|
|
35
|
+
],
|
|
36
|
+
"main": "dist/index.js",
|
|
37
|
+
"types": "dist/index.d.ts",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@eslint/eslintrc": "^3.0.0",
|
|
40
|
+
"@intlify/core-base": "^11.0.0",
|
|
41
|
+
"@intlify/message-compiler": "^11.0.0",
|
|
42
|
+
"debug": "^4.3.4",
|
|
43
|
+
"eslint-compat-utils": "^0.6.0",
|
|
44
|
+
"glob": "^10.3.3",
|
|
45
|
+
"globals": "^16.0.0",
|
|
46
|
+
"ignore": "^7.0.0",
|
|
47
|
+
"import-fresh": "^3.3.0",
|
|
48
|
+
"is-language-code": "^3.1.0",
|
|
49
|
+
"js-yaml": "^4.1.0",
|
|
50
|
+
"json5": "^2.2.3",
|
|
51
|
+
"lodash": "^4.17.21",
|
|
52
|
+
"parse5": "^7.1.2",
|
|
53
|
+
"semver": "^7.5.4",
|
|
54
|
+
"synckit": "^0.10.0"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@changesets/changelog-github": "^0.5.0",
|
|
58
|
+
"@changesets/cli": "^2.26.2",
|
|
59
|
+
"@swc-node/register": "^1.11.1",
|
|
60
|
+
"@types/debug": "^4.1.8",
|
|
61
|
+
"@types/eslint-scope": "^8.0.0",
|
|
62
|
+
"@types/glob": "^9.0.0",
|
|
63
|
+
"@types/js-yaml": "^4.0.5",
|
|
64
|
+
"@types/json-schema": "^7.0.12",
|
|
65
|
+
"@types/lodash": "^4.14.196",
|
|
66
|
+
"@types/mocha": "^10.0.1",
|
|
67
|
+
"@types/node": "^22.0.0",
|
|
68
|
+
"@types/prettier": "^3.0.0",
|
|
69
|
+
"@types/semver": "^7.5.0",
|
|
70
|
+
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
71
|
+
"@typescript-eslint/parser": "^7.0.0",
|
|
72
|
+
"entities": "^6.0.0",
|
|
73
|
+
"env-cmd": "^10.1.0",
|
|
74
|
+
"eslint": "^9.4.0",
|
|
75
|
+
"eslint-config-prettier": "^10.0.0",
|
|
76
|
+
"eslint-plugin-markdown": "^5.0.0",
|
|
77
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
78
|
+
"eslint-plugin-vue": "^10.0.0",
|
|
79
|
+
"eslint4b": "^7.32.0",
|
|
80
|
+
"espree": "^10.0.0",
|
|
81
|
+
"esquery": "^1.5.0",
|
|
82
|
+
"jiti": "^1.21.0",
|
|
83
|
+
"json-schema": "^0.4.0",
|
|
84
|
+
"jsonc-eslint-parser": "^2.3.0",
|
|
85
|
+
"lint-staged": "^16.0.0",
|
|
86
|
+
"mocha": "^11.7.5",
|
|
87
|
+
"monaco-editor": "^0.55.0",
|
|
88
|
+
"npm-run-all2": "8.0.4",
|
|
89
|
+
"nyc": "^17.0.0",
|
|
90
|
+
"opener": "^1.5.2",
|
|
91
|
+
"path-scurry": "^1.10.1",
|
|
92
|
+
"prettier": "^3.4.2",
|
|
93
|
+
"ts-node": "^10.9.2",
|
|
94
|
+
"typescript": "^5.1.6",
|
|
95
|
+
"typescript-eslint": "^7.11.0",
|
|
96
|
+
"vitepress": "^1.0.2",
|
|
97
|
+
"vue-eslint-editor": "^1.1.0",
|
|
98
|
+
"vue-eslint-parser": "^10.0.0",
|
|
99
|
+
"vue-github-button": "^3.1.0",
|
|
100
|
+
"yaml-eslint-parser": "^1.2.2"
|
|
101
|
+
},
|
|
102
|
+
"peerDependencies": {
|
|
103
|
+
"eslint": "^8.0.0 || ^9.0.0-0",
|
|
104
|
+
"jsonc-eslint-parser": "^2.3.0",
|
|
105
|
+
"vue-eslint-parser": "^10.0.0",
|
|
106
|
+
"yaml-eslint-parser": "^1.2.2"
|
|
107
|
+
},
|
|
108
|
+
"publishConfig": {
|
|
109
|
+
"access": "public"
|
|
110
|
+
},
|
|
111
|
+
"lint-staged": {
|
|
112
|
+
"*.{json,md,yml}": [
|
|
113
|
+
"prettier --write"
|
|
114
|
+
],
|
|
115
|
+
"*.{js?(x)}": [
|
|
116
|
+
"prettier --write",
|
|
117
|
+
"eslint --fix"
|
|
118
|
+
],
|
|
119
|
+
"*.ts?(x)": [
|
|
120
|
+
"prettier --parser=typescript --write",
|
|
121
|
+
"eslint --fix"
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"scripts": {
|
|
125
|
+
"build": "tsc --project ./tsconfig.build.json",
|
|
126
|
+
"clean": "git clean -fx .nyc_output coverage dist docs/.vitepress/dist",
|
|
127
|
+
"coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html",
|
|
128
|
+
"docs": "vitepress dev docs",
|
|
129
|
+
"docs:build": "vitepress build docs",
|
|
130
|
+
"generate": "env-cmd -e script -- jiti scripts/update.ts",
|
|
131
|
+
"fix": "run-p fix:*",
|
|
132
|
+
"fix:eslint": "pnpm run lint:eslint --fix",
|
|
133
|
+
"fix:prettier": "prettier --write .",
|
|
134
|
+
"lint": "run-s lint:*",
|
|
135
|
+
"lint:eslint": "eslint . --ignore-pattern \"tests/fixtures/\"",
|
|
136
|
+
"lint:prettier": "prettier --check .",
|
|
137
|
+
"prerelease": "pnpm run test && pnpm run build",
|
|
138
|
+
"release": "changeset publish",
|
|
139
|
+
"test": "env-cmd -e test -- mocha --require @swc-node/register \"./tests/lib/**/*.ts\" --timeout 5000",
|
|
140
|
+
"test:debug": "env-cmd -e test -- mocha --require @swc-node/register \"./tests/lib/**/*.ts\"",
|
|
141
|
+
"test:coverage": "nyc env-cmd -e test -- mocha --require @swc-node/register \"./tests/lib/**/*.ts\" --timeout 60000",
|
|
142
|
+
"test:integrations": "mocha --require @swc-node/register \"./tests/integrations/*.ts\" --timeout 60000",
|
|
143
|
+
"new": "jiti ./scripts/new-rule.ts",
|
|
144
|
+
"version:ci": "env-cmd -e version-ci -- pnpm run generate && changeset version",
|
|
145
|
+
"changeset": "changeset"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 Toru Nagashima
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
# vue-eslint-parser
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/vue-eslint-parser)
|
|
4
|
+
[](http://www.npmtrends.com/vue-eslint-parser)
|
|
5
|
+
[](https://github.com/vuejs/vue-eslint-parser/actions)
|
|
6
|
+
|
|
7
|
+
The ESLint custom parser for `.vue` files.
|
|
8
|
+
|
|
9
|
+
## ⤴️ Motivation
|
|
10
|
+
|
|
11
|
+
This parser allows us to lint the `<template>` of `.vue` files. We can make mistakes easily on `<template>` if we use complex directives and expressions in the template. This parser and the rules of [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) would catch some of the mistakes.
|
|
12
|
+
|
|
13
|
+
## 💿 Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install --save-dev eslint vue-eslint-parser
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 📖 Usage
|
|
20
|
+
|
|
21
|
+
Write `parser` option into your `eslint.config.*` file.
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import vueParser from "vue-eslint-parser"
|
|
25
|
+
export default [
|
|
26
|
+
js.configs.recommended,
|
|
27
|
+
{
|
|
28
|
+
files: ["*.vue", "**/*.vue"],
|
|
29
|
+
languageOptions: {
|
|
30
|
+
parser: vueParser,
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 🔧 Options
|
|
37
|
+
|
|
38
|
+
`parserOptions` has the same properties as what [espree](https://github.com/eslint/espree#usage), the default parser of ESLint, is supporting.
|
|
39
|
+
For example:
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
import vueParser from "vue-eslint-parser"
|
|
43
|
+
export default [
|
|
44
|
+
{
|
|
45
|
+
files: ["*.vue", "**/*.vue"],
|
|
46
|
+
languageOptions: {
|
|
47
|
+
parser: vueParser,
|
|
48
|
+
sourceType: "module",
|
|
49
|
+
ecmaVersion: "latest",
|
|
50
|
+
parserOptions: {
|
|
51
|
+
ecmaFeatures: {
|
|
52
|
+
globalReturn: false,
|
|
53
|
+
impliedStrict: false,
|
|
54
|
+
jsx: false
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### parserOptions.parser
|
|
63
|
+
|
|
64
|
+
You can use `parserOptions.parser` property to specify a custom parser to parse `<script>` tags.
|
|
65
|
+
Other properties than parser would be given to the specified parser.
|
|
66
|
+
For example:
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
import vueParser from "vue-eslint-parser"
|
|
70
|
+
import babelParser from "@babel/eslint-parser"
|
|
71
|
+
export default [
|
|
72
|
+
{
|
|
73
|
+
files: ["*.vue", "**/*.vue"],
|
|
74
|
+
languageOptions: {
|
|
75
|
+
parser: vueParser,
|
|
76
|
+
parserOptions: {
|
|
77
|
+
parser: babelParser,
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```js
|
|
85
|
+
import vueParser from "vue-eslint-parser"
|
|
86
|
+
import tsParser from "@typescript-eslint/parser"
|
|
87
|
+
export default [
|
|
88
|
+
{
|
|
89
|
+
files: ["*.vue", "**/*.vue"],
|
|
90
|
+
languageOptions: {
|
|
91
|
+
parser: vueParser,
|
|
92
|
+
parserOptions: {
|
|
93
|
+
parser: tsParser,
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
You can also specify an object and change the parser separately for `<script lang="...">`.
|
|
101
|
+
|
|
102
|
+
```js
|
|
103
|
+
import vueParser from "vue-eslint-parser"
|
|
104
|
+
import tsParser from "@typescript-eslint/parser"
|
|
105
|
+
export default [
|
|
106
|
+
{
|
|
107
|
+
files: ["*.vue", "**/*.vue"],
|
|
108
|
+
languageOptions: {
|
|
109
|
+
parser: vueParser,
|
|
110
|
+
parserOptions: {
|
|
111
|
+
"parser": {
|
|
112
|
+
// Script parser for `<script>`
|
|
113
|
+
"js": "espree",
|
|
114
|
+
|
|
115
|
+
// Script parser for `<script lang="ts">`
|
|
116
|
+
"ts": tsParser,
|
|
117
|
+
|
|
118
|
+
// Script parser for vue directives (e.g. `v-if=` or `:attribute=`)
|
|
119
|
+
// and vue interpolations (e.g. `{{variable}}`).
|
|
120
|
+
// If not specified, the parser determined by `<script lang ="...">` is used.
|
|
121
|
+
"<template>": "espree",
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
If the `parserOptions.parser` is `false`, the `vue-eslint-parser` skips parsing `<script>` tags completely.
|
|
130
|
+
This is useful for people who use the language ESLint community doesn't provide custom parser implementation.
|
|
131
|
+
|
|
132
|
+
### parserOptions.vueFeatures
|
|
133
|
+
|
|
134
|
+
You can use `parserOptions.vueFeatures` property to specify how to parse related to Vue features.
|
|
135
|
+
For example:
|
|
136
|
+
|
|
137
|
+
```js
|
|
138
|
+
import vueParser from "vue-eslint-parser"
|
|
139
|
+
export default [
|
|
140
|
+
{
|
|
141
|
+
files: ["*.vue", "**/*.vue"],
|
|
142
|
+
languageOptions: {
|
|
143
|
+
parser: vueParser,
|
|
144
|
+
parserOptions: {
|
|
145
|
+
vueFeatures: {
|
|
146
|
+
filter: true,
|
|
147
|
+
interpolationAsNonHTML: true,
|
|
148
|
+
styleCSSVariableInjection: true,
|
|
149
|
+
customMacros: []
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### parserOptions.vueFeatures.filter
|
|
158
|
+
|
|
159
|
+
You can use `parserOptions.vueFeatures.filter` property to specify whether to parse the Vue2 filter. If you specify `false`, the parser does not parse `|` as a filter.
|
|
160
|
+
For example:
|
|
161
|
+
|
|
162
|
+
```json
|
|
163
|
+
{
|
|
164
|
+
"parserOptions": {
|
|
165
|
+
"vueFeatures": {
|
|
166
|
+
"filter": false
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
If you specify `false`, it can be parsed in the same way as Vue 3.
|
|
173
|
+
The following template parses as a bitwise operation.
|
|
174
|
+
|
|
175
|
+
```vue
|
|
176
|
+
<template>
|
|
177
|
+
<div>{{ a | b }}</div>
|
|
178
|
+
</template>
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
However, the following template that are valid in Vue 2 cannot be parsed.
|
|
182
|
+
|
|
183
|
+
```vue
|
|
184
|
+
<template>
|
|
185
|
+
<div>{{ a | valid:filter }}</div>
|
|
186
|
+
</template>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### parserOptions.vueFeatures.interpolationAsNonHTML
|
|
190
|
+
|
|
191
|
+
You can use `parserOptions.vueFeatures.interpolationAsNonHTML` property to specify whether to parse the interpolation as HTML. If you specify `true`, the parser handles the interpolation as non-HTML (However, you can use HTML escaping in the interpolation). Default is `true`.
|
|
192
|
+
For example:
|
|
193
|
+
|
|
194
|
+
```json
|
|
195
|
+
{
|
|
196
|
+
"parserOptions": {
|
|
197
|
+
"vueFeatures": {
|
|
198
|
+
"interpolationAsNonHTML": true
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
If you specify `true`, it can be parsed in the same way as Vue 3.
|
|
205
|
+
The following template can be parsed well.
|
|
206
|
+
|
|
207
|
+
```vue
|
|
208
|
+
<template>
|
|
209
|
+
<div>{{a<b}}</div>
|
|
210
|
+
</template>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
But, it cannot be parsed with Vue 2.
|
|
214
|
+
|
|
215
|
+
### parserOptions.vueFeatures.styleCSSVariableInjection
|
|
216
|
+
|
|
217
|
+
If set to `true`, to parse expressions in `v-bind` CSS functions inside `<style>` tags. `v-bind()` is parsed into the `VExpressionContainer` AST node and held in the `VElement` of `<style>`. Default is `true`.
|
|
218
|
+
|
|
219
|
+
See also to [here](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0043-sfc-style-variables.md).
|
|
220
|
+
|
|
221
|
+
### parserOptions.vueFeatures.customMacros
|
|
222
|
+
|
|
223
|
+
Specifies an array of names of custom macros other than Vue standard macros.
|
|
224
|
+
For example, if you have a custom macro `defineFoo()` and you want it processed by the parser, specify `["defineFoo"]`.
|
|
225
|
+
|
|
226
|
+
Note that this option only works in `<script setup>`.
|
|
227
|
+
|
|
228
|
+
### parserOptions.templateTokenizer
|
|
229
|
+
|
|
230
|
+
**This is an experimental feature. It may be changed or deleted without notice in the minor version.**
|
|
231
|
+
|
|
232
|
+
You can use `parserOptions.templateTokenizer` property to specify custom tokenizers to parse `<template lang="...">` tags.
|
|
233
|
+
|
|
234
|
+
For example to enable parsing of pug templates:
|
|
235
|
+
|
|
236
|
+
```jsonc
|
|
237
|
+
{
|
|
238
|
+
"parserOptions": {
|
|
239
|
+
"templateTokenizer": {
|
|
240
|
+
// template tokenizer for `<template lang="pug">`
|
|
241
|
+
"pug": "vue-eslint-parser-template-tokenizer-pug",
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
This option is only intended for plugin developers. **Be careful** when using this option directly, as it may change behaviour of rules you might have enabled.
|
|
248
|
+
If you just want **pug** support, use [eslint-plugin-vue-pug](https://github.com/rashfael/eslint-plugin-vue-pug) instead, which uses this option internally.
|
|
249
|
+
|
|
250
|
+
See [implementing-custom-template-tokenizers.md](./docs/implementing-custom-template-tokenizers.md) for information on creating your own template tokenizer.
|
|
251
|
+
|
|
252
|
+
## 🎇 Usage for custom rules / plugins
|
|
253
|
+
|
|
254
|
+
- This parser provides `parserServices` to traverse `<template>`.
|
|
255
|
+
- `defineTemplateBodyVisitor(templateVisitor, scriptVisitor, options)` ... returns ESLint visitor to traverse `<template>`.
|
|
256
|
+
- `getTemplateBodyTokenStore()` ... returns ESLint `TokenStore` to get the tokens of `<template>`.
|
|
257
|
+
- `getDocumentFragment()` ... returns the root `VDocumentFragment`.
|
|
258
|
+
- `defineCustomBlocksVisitor(context, customParser, rule, scriptVisitor)` ... returns ESLint visitor that parses and traverses the contents of the custom block.
|
|
259
|
+
- `defineDocumentVisitor(documentVisitor, options)` ... returns ESLint visitor to traverses the document.
|
|
260
|
+
- [ast.md](./docs/ast.md) is `<template>` AST specification.
|
|
261
|
+
- [mustache-interpolation-spacing.js](https://github.com/vuejs/eslint-plugin-vue/blob/b434ff99d37f35570fa351681e43ba2cf5746db3/lib/rules/mustache-interpolation-spacing.js) is an example.
|
|
262
|
+
- Check your version of ESLint as the location of `defineTemplateBodyVisitor` was moved from `context` to `context.sourceCode` after major version `9.x`
|
|
263
|
+
|
|
264
|
+
### `defineTemplateBodyVisitor(templateBodyVisitor, scriptVisitor, options)`
|
|
265
|
+
|
|
266
|
+
*Arguments*
|
|
267
|
+
|
|
268
|
+
- `templateBodyVisitor` ... Event handlers for `<template>`.
|
|
269
|
+
- `scriptVisitor` ... Event handlers for `<script>` or scripts. (optional)
|
|
270
|
+
- `options` ... Options. (optional)
|
|
271
|
+
- `templateBodyTriggerSelector` ... Script AST node selector that triggers the templateBodyVisitor. Default is `"Program:exit"`. (optional)
|
|
272
|
+
|
|
273
|
+
```ts
|
|
274
|
+
import { AST } from "vue-eslint-parser"
|
|
275
|
+
|
|
276
|
+
export function create(context) {
|
|
277
|
+
return context.sourceCode.parserServices.defineTemplateBodyVisitor(
|
|
278
|
+
// Event handlers for <template>.
|
|
279
|
+
{
|
|
280
|
+
VElement(node: AST.VElement): void {
|
|
281
|
+
//...
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
// Event handlers for <script> or scripts. (optional)
|
|
285
|
+
{
|
|
286
|
+
Program(node: AST.ESLintProgram): void {
|
|
287
|
+
//...
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
// Options. (optional)
|
|
291
|
+
{
|
|
292
|
+
templateBodyTriggerSelector: "Program:exit"
|
|
293
|
+
}
|
|
294
|
+
)
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## ⚠️ Known Limitations
|
|
299
|
+
|
|
300
|
+
Some rules make warnings due to the outside of `<script>` tags.
|
|
301
|
+
Please disable those rules for `.vue` files as necessary.
|
|
302
|
+
|
|
303
|
+
- [eol-last](http://eslint.org/docs/rules/eol-last)
|
|
304
|
+
- [linebreak-style](http://eslint.org/docs/rules/linebreak-style)
|
|
305
|
+
- [max-len](http://eslint.org/docs/rules/max-len)
|
|
306
|
+
- [max-lines](http://eslint.org/docs/rules/max-lines)
|
|
307
|
+
- [no-trailing-spaces](http://eslint.org/docs/rules/no-trailing-spaces)
|
|
308
|
+
- [unicode-bom](http://eslint.org/docs/rules/unicode-bom)
|
|
309
|
+
- Other rules which are using the source code text instead of AST might be confused as well.
|
|
310
|
+
|
|
311
|
+
## 📰 Changelog
|
|
312
|
+
|
|
313
|
+
- [GitHub Releases](https://github.com/vuejs/vue-eslint-parser/releases)
|
|
314
|
+
|
|
315
|
+
## 🍻 Contributing
|
|
316
|
+
|
|
317
|
+
Welcome contributing!
|
|
318
|
+
|
|
319
|
+
Please use GitHub's Issues/PRs.
|
|
320
|
+
|
|
321
|
+
If you want to write code, please execute `npm install` after you cloned this repository.
|
|
322
|
+
The `npm install` command installs dependencies.
|
|
323
|
+
|
|
324
|
+
### Development Tools
|
|
325
|
+
|
|
326
|
+
- `npm test` runs tests and measures coverage.
|
|
327
|
+
- `npm run build` compiles TypeScript source code to `index.js`, `index.js.map`, and `index.d.ts`.
|
|
328
|
+
- `npm run coverage` shows the coverage result of `npm test` command with the default browser.
|
|
329
|
+
- `npm run clean` removes the temporary files which are created by `npm test` and `npm run build`.
|
|
330
|
+
- `npm run lint` runs ESLint.
|
|
331
|
+
- `npm run update-fixtures` updates files in `test/fixtures/ast` directory based on `test/fixtures/ast/*/source.vue` files.
|
|
332
|
+
- `npm run watch` runs `build`, `update-fixtures`, and tests with `--watch` option.
|