Skip to content

Commit

Permalink
Dogfood the rule on the test folder
Browse files Browse the repository at this point in the history
  • Loading branch information
lydell committed Feb 10, 2024
1 parent 67bd361 commit 80867d1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.dogfood.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"rules": {
"imports": "error",
"exports": "error"
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": "latest"
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"private": true,
"type": "commonjs",
"scripts": {
"pretest": "prettier --check . && eslint . --report-unused-disable-directives",
"pretest": "prettier --check . && eslint . --report-unused-disable-directives && npm run dogfood",
"test": "vitest run",
"posttest": "npm run build",
"build": "node build.js",
"dogfood": "eslint --rulesdir src --config .eslintrc.dogfood.json test",
"examples": "eslint --rulesdir src --no-ignore --fix-dry-run --format json --report-unused-disable-directives examples --ext .js,.ts,.vue,.md"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion test/examples.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, expect, test } from "vitest";
import { spawnSync } from "child_process";
import { readFileSync } from "fs";
import { basename } from "path";
import { format } from "prettier";
import { describe, expect, test } from "vitest";

// Make snapshots easier to read.
// Before: `"\\"string\\""`
Expand Down

0 comments on commit 80867d1

Please sign in to comment.