eslint-plugin-vue-scoped-css 2.4.0 → 2.5.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.
@@ -37,7 +37,12 @@ function getVueComponentObject(node) {
37
37
  }
38
38
  return null;
39
39
  }
40
+ const vueComponentCache = new WeakMap();
40
41
  function findVueComponent(context) {
42
+ const cached = vueComponentCache.get(context);
43
+ if (cached !== undefined && cached.cachedAt > Date.now() - 1000) {
44
+ return cached.component;
45
+ }
41
46
  const sourceCode = context.getSourceCode();
42
47
  const componentComments = sourceCode
43
48
  .getAllComments()
@@ -77,6 +82,10 @@ function findVueComponent(context) {
77
82
  leaveNode() {
78
83
  },
79
84
  });
85
+ vueComponentCache.set(context, {
86
+ component: result,
87
+ cachedAt: Date.now(),
88
+ });
80
89
  return result;
81
90
  }
82
91
  exports.default = findVueComponent;
@@ -245,7 +245,8 @@ function getESLintLineAndColumnFromPostCSSNode(offsetLocation, node, locName) {
245
245
  return null;
246
246
  }
247
247
  const { line, column } = getESLintLineAndColumnFromPostCSSPosition(offsetLocation, sourceLoc);
248
- if (locName === "end") {
248
+ if (locName === "end" &&
249
+ node.type !== "root") {
249
250
  return { line, column: column + 1 };
250
251
  }
251
252
  return { line, column };
@@ -205,5 +205,5 @@ class Template {
205
205
  return text;
206
206
  }
207
207
  }
208
- exports.Template = Template;
209
208
  Template.interpolationTemplate = new Template([new interpolation_1.Interpolation("?")]);
209
+ exports.Template = Template;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-vue-scoped-css",
3
- "version": "2.4.0",
3
+ "version": "2.5.1",
4
4
  "description": "ESLint plugin for Scoped CSS in Vue.js",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -52,7 +52,7 @@
52
52
  ],
53
53
  "devDependencies": {
54
54
  "@changesets/cli": "^2.24.2",
55
- "@ota-meshi/eslint-plugin": "^0.13.0",
55
+ "@ota-meshi/eslint-plugin": "^0.15.0",
56
56
  "@svitejs/changesets-changelog-github-compact": "^1.1.0",
57
57
  "@types/eslint": "^8.0.0",
58
58
  "@types/eslint-visitor-keys": "^1.0.0",
@@ -60,17 +60,17 @@
60
60
  "@types/lodash": "^4.14.158",
61
61
  "@types/mocha": "^10.0.0",
62
62
  "@types/semver": "^7.3.1",
63
- "@typescript-eslint/eslint-plugin": "^5.49.0",
64
- "@typescript-eslint/parser": "^5.49.0",
63
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
64
+ "@typescript-eslint/parser": "^6.0.0",
65
65
  "cross-env": "^7.0.2",
66
66
  "eslint": "^8.0.0",
67
- "eslint-config-prettier": "^8.0.0",
67
+ "eslint-config-prettier": "^9.0.0",
68
68
  "eslint-plugin-eslint-comments": "^3.2.0",
69
69
  "eslint-plugin-eslint-plugin": "^5.0.0",
70
70
  "eslint-plugin-json-schema-validator": "^4.0.0",
71
71
  "eslint-plugin-jsonc": "^2.0.0",
72
- "eslint-plugin-node": "^11.1.0",
73
- "eslint-plugin-prettier": "^4.0.0",
72
+ "eslint-plugin-n": "^16.0.0",
73
+ "eslint-plugin-prettier": "^5.0.0",
74
74
  "eslint-plugin-regexp": "^1.0.0",
75
75
  "eslint-plugin-vue": "^9.0.0",
76
76
  "eslint-plugin-vue-scoped-css": "^2.0.0",
@@ -78,16 +78,16 @@
78
78
  "mocha": "^10.0.0",
79
79
  "nyc": "^15.1.0",
80
80
  "pack": "^2.2.0",
81
- "prettier": "^2.0.5",
81
+ "prettier": "^3.0.0",
82
82
  "raw-loader": "^4.0.1",
83
83
  "rimraf": "^3.0.2",
84
84
  "semver": "^7.3.2",
85
- "stylelint": "^14.9.1",
85
+ "stylelint": "^15.0.0",
86
86
  "stylelint-config-recommended-vue": "^1.1.0",
87
- "stylelint-config-standard": "^29.0.0",
88
- "stylelint-stylus": "^0.17.0",
87
+ "stylelint-config-standard": "^34.0.0",
88
+ "stylelint-stylus": "^0.18.0",
89
89
  "ts-node": "^10.9.1",
90
- "typescript": "^4.9.4",
90
+ "typescript": "^5.0.0",
91
91
  "vue-eslint-editor": "^1.1.0",
92
92
  "vue-eslint-parser": "^9.0.0",
93
93
  "vuepress": "^1.8.2"
@@ -95,7 +95,7 @@
95
95
  "dependencies": {
96
96
  "eslint-utils": "^3.0.0",
97
97
  "lodash": "^4.17.21",
98
- "postcss": "^8.4.6",
98
+ "postcss": "^8.4.31",
99
99
  "postcss-safe-parser": "^6.0.0",
100
100
  "postcss-scss": "^4.0.3",
101
101
  "postcss-selector-parser": "^6.0.9",