Skip to content

fix(deps): update dependency eslint-compat-utils to ^0.2.0 #326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/swift-dolls-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eslint-plugin-vue-scoped-css": minor
---

fix(deps): update dependency eslint-compat-utils to ^0.2.0
13 changes: 13 additions & 0 deletions .github/workflows/NodeCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ jobs:
run: npm run build
- name: Test
run: npm test
test-with-eslint9:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
- name: Install Target Packages
run: |+
npm i -D eslint@^9.0.0-0 --legacy-peer-deps
npx rimraf node_modules
npm install -f
- name: Test
run: npm test
test-with-eslint6:
runs-on: ubuntu-latest
strategy:
Expand Down
31 changes: 15 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
},
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"eslint-compat-utils": "^0.1.2",
"eslint-compat-utils": "^0.2.1",
"lodash": "^4.17.21",
"postcss": "^8.4.31",
"postcss-safe-parser": "^6.0.0",
Expand Down
22 changes: 15 additions & 7 deletions tests/lib/comment-directives.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { RuleTester } from "eslint";
import { RuleTester } from "./test-lib/eslint-compat";
import { Linter } from "eslint";
import rule = require("../../lib/rules/no-unused-selector");
import * as semver from "semver";

import * as vueParser from "vue-eslint-parser";

const testRulePrefix = semver.gte(Linter.version, "9.0.0-0")
? "rule-to-test/"
: "";

const tester = new RuleTester({
parser: require.resolve("vue-eslint-parser"),
parserOptions: {
languageOptions: {
parser: vueParser,
ecmaVersion: 2019,
sourceType: "module",
},
Expand Down Expand Up @@ -59,10 +67,10 @@ tester.run("no-unused-selector-comment-directives", rule as any, {
</ul></div>
</template>
<style scoped>
/* eslint-disable-next-line no-unused-selector-comment-directives */
/* eslint-disable-next-line ${testRulePrefix}no-unused-selector-comment-directives */
div {
& > .foo,
& > li.foo {/* eslint-disable-line no-unused-selector-comment-directives */
& > li.foo {/* eslint-disable-line ${testRulePrefix}no-unused-selector-comment-directives */
}
& > li.bar {}
}
Expand Down Expand Up @@ -120,10 +128,10 @@ tester.run("no-unused-selector-comment-directives", rule as any, {
</ul></div>
</template>
<style scoped>
/* eslint-disable no-unused-selector-comment-directives */
/* eslint-disable ${testRulePrefix}no-unused-selector-comment-directives */
div {
& > .foo,
/* eslint-enable no-unused-selector-comment-directives */ & > li.foo {
/* eslint-enable ${testRulePrefix}no-unused-selector-comment-directives */ & > li.foo {
}
& > li.bar {}
}
Expand Down
14 changes: 9 additions & 5 deletions tests/lib/rules-without-vue-eslint-parser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Linter } from "eslint";
import { getLinter } from "eslint-compat-utils/linter";
import plugin = require("../../lib/index");
// eslint-disable-next-line @typescript-eslint/naming-convention -- Class name
const Linter = getLinter();

describe("Don't crash even if without vue-eslint-parser.", () => {
const code = "<style scoped>.a {}</style>";
Expand All @@ -10,17 +12,19 @@ describe("Don't crash even if without vue-eslint-parser.", () => {
it(ruleId, () => {
const linter = new Linter();
const config = {
parserOptions: {
languageOptions: {
ecmaVersion: 2015,
ecmaFeatures: {
jsx: true,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
plugins: { "vue-scoped-css": plugin },
rules: {
[ruleId]: "error",
},
};
linter.defineRule(ruleId, plugin.rules[key] as any);
linter.verifyAndFix(code, config as any, "test.vue");
});
}
Expand Down
8 changes: 5 additions & 3 deletions tests/lib/rules/enforce-style-type.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { RuleTester } from "eslint";
import { RuleTester } from "../test-lib/eslint-compat";
import rule = require("../../../lib/rules/enforce-style-type");

import * as vueParser from "vue-eslint-parser";

const tester = new RuleTester({
parser: require.resolve("vue-eslint-parser"),
parserOptions: {
languageOptions: {
parser: vueParser,
ecmaVersion: 2019,
sourceType: "module",
},
Expand Down
8 changes: 5 additions & 3 deletions tests/lib/rules/no-deprecated-deep-combinator.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { RuleTester } from "eslint";
import { RuleTester } from "../test-lib/eslint-compat";
import rule = require("../../../lib/rules/no-deprecated-deep-combinator");

import * as vueParser from "vue-eslint-parser";

const tester = new RuleTester({
parser: require.resolve("vue-eslint-parser"),
parserOptions: {
languageOptions: {
parser: vueParser,
ecmaVersion: 2019,
sourceType: "module",
},
Expand Down
8 changes: 5 additions & 3 deletions tests/lib/rules/no-deprecated-v-enter-v-leave-class.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { RuleTester } from "eslint";
import { RuleTester } from "../test-lib/eslint-compat";
import rule = require("../../../lib/rules/no-deprecated-v-enter-v-leave-class");

import * as vueParser from "vue-eslint-parser";

const tester = new RuleTester({
parser: require.resolve("vue-eslint-parser"),
parserOptions: {
languageOptions: {
parser: vueParser,
ecmaVersion: 2019,
sourceType: "module",
},
Expand Down
8 changes: 5 additions & 3 deletions tests/lib/rules/no-parent-of-v-global.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { RuleTester } from "eslint";
import { RuleTester } from "../test-lib/eslint-compat";
import rule = require("../../../lib/rules/no-parent-of-v-global");

import * as vueParser from "vue-eslint-parser";

const tester = new RuleTester({
parser: require.resolve("vue-eslint-parser"),
parserOptions: {
languageOptions: {
parser: vueParser,
ecmaVersion: 2019,
sourceType: "module",
},
Expand Down
8 changes: 5 additions & 3 deletions tests/lib/rules/no-parsing-error.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { RuleTester } from "eslint";
import { RuleTester } from "../test-lib/eslint-compat";
import semver from "semver";
import rule = require("../../../lib/rules/no-parsing-error");
const parserVersion = require("vue-eslint-parser/package.json").version;

import * as vueParser from "vue-eslint-parser";

const tester = new RuleTester({
parser: require.resolve("vue-eslint-parser"),
parserOptions: {
languageOptions: {
parser: vueParser,
ecmaVersion: 2019,
sourceType: "module",
},
Expand Down
8 changes: 5 additions & 3 deletions tests/lib/rules/no-unused-keyframes.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { RuleTester } from "eslint";
import { RuleTester } from "../test-lib/eslint-compat";
import rule = require("../../../lib/rules/no-unused-keyframes");

import * as vueParser from "vue-eslint-parser";

const tester = new RuleTester({
parser: require.resolve("vue-eslint-parser"),
parserOptions: {
languageOptions: {
parser: vueParser,
ecmaVersion: 2019,
sourceType: "module",
},
Expand Down
8 changes: 5 additions & 3 deletions tests/lib/rules/no-unused-selector.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { RuleTester } from "eslint";
import { RuleTester } from "../test-lib/eslint-compat";
import rule = require("../../../lib/rules/no-unused-selector");

import * as vueParser from "vue-eslint-parser";

const tester = new RuleTester({
parser: require.resolve("vue-eslint-parser"),
parserOptions: {
languageOptions: {
parser: vueParser,
ecmaVersion: 2019,
sourceType: "module",
},
Expand Down
8 changes: 5 additions & 3 deletions tests/lib/rules/require-scoped.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { RuleTester } from "eslint";
import { RuleTester } from "../test-lib/eslint-compat";
import semver from "semver";
import rule = require("../../../lib/rules/require-scoped");

const parserVersion = require("vue-eslint-parser/package.json").version;

import * as vueParser from "vue-eslint-parser";

const tester = new RuleTester({
parser: require.resolve("vue-eslint-parser"),
parserOptions: {
languageOptions: {
parser: vueParser,
ecmaVersion: 2019,
sourceType: "module",
},
Expand Down
8 changes: 5 additions & 3 deletions tests/lib/rules/require-selector-used-inside.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { RuleTester } from "eslint";
import { RuleTester } from "../test-lib/eslint-compat";
import rule = require("../../../lib/rules/require-selector-used-inside");

import * as vueParser from "vue-eslint-parser";

const tester = new RuleTester({
parser: require.resolve("vue-eslint-parser"),
parserOptions: {
languageOptions: {
parser: vueParser,
ecmaVersion: 2019,
sourceType: "module",
},
Expand Down
8 changes: 5 additions & 3 deletions tests/lib/rules/require-v-deep-argument.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { RuleTester } from "eslint";
import { RuleTester } from "../test-lib/eslint-compat";
import rule = require("../../../lib/rules/require-v-deep-argument");

import * as vueParser from "vue-eslint-parser";

const tester = new RuleTester({
parser: require.resolve("vue-eslint-parser"),
parserOptions: {
languageOptions: {
parser: vueParser,
ecmaVersion: 2019,
sourceType: "module",
},
Expand Down
8 changes: 5 additions & 3 deletions tests/lib/rules/require-v-global-argument.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { RuleTester } from "eslint";
import { RuleTester } from "../test-lib/eslint-compat";
import rule = require("../../../lib/rules/require-v-global-argument");

import * as vueParser from "vue-eslint-parser";

const tester = new RuleTester({
parser: require.resolve("vue-eslint-parser"),
parserOptions: {
languageOptions: {
parser: vueParser,
ecmaVersion: 2019,
sourceType: "module",
},
Expand Down
8 changes: 5 additions & 3 deletions tests/lib/rules/require-v-slotted-argument.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { RuleTester } from "eslint";
import { RuleTester } from "../test-lib/eslint-compat";
import rule = require("../../../lib/rules/require-v-slotted-argument");

import * as vueParser from "vue-eslint-parser";

const tester = new RuleTester({
parser: require.resolve("vue-eslint-parser"),
parserOptions: {
languageOptions: {
parser: vueParser,
ecmaVersion: 2019,
sourceType: "module",
},
Expand Down
Loading