Skip to content
Draft
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
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,16 @@ jobs:
run: npm run build
- name: Run tests
run: npm run test
are-the-types-wrong:
name: Are the types wrong?
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm install
- name: Are the types wrong?
run: npm run lint:types
25 changes: 22 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { defineConfig, globalIgnores } from "eslint/config";
import eslintConfigESLint from "eslint-config-eslint";
import eslintConfigESLintFormatting from "eslint-config-eslint/formatting";
import eslintPluginChaiFriendly from "eslint-plugin-chai-friendly";
import * as expectType from "eslint-plugin-expect-type";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";

export default defineConfig([
globalIgnores([
Expand All @@ -11,8 +13,10 @@ export default defineConfig([
"**/coverage/",
"packages/espree/tools/create-test-example.js"
]),
eslintConfigESLint,
eslintConfigESLintFormatting,
{
files: ["**/*.{,c}js"],
extends: [eslintConfigESLint, eslintConfigESLintFormatting]
},
{
files: ["packages/*/tests/lib/**"],
languageOptions: {
Expand All @@ -22,7 +26,7 @@ export default defineConfig([
}
},
{
files: ["packages/eslint-scope/tests/**"],
files: ["packages/eslint-scope/tests/**/*.{,c}js"],
languageOptions: {
globals: {
...globals.mocha
Expand Down Expand Up @@ -68,6 +72,21 @@ export default defineConfig([
}
}
},
{
files: ["packages/eslint-scope/tests/types/*.{,c}ts"],
languageOptions: {
parser: tsParser,
parserOptions: {
project: ["packages/eslint-scope/tests/types/tsconfig.json"]
}
},
plugins: {
"expect-type": expectType
},
rules: {
"expect-type/expect": "error"
}
},
{
files: ["**/tools/**"],
rules: {
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"test": "npm test --workspaces --if-present",
"build": "npm run build --workspaces --if-present",
"lint": "eslint",
"lint:fix": "eslint --fix"
"lint:fix": "eslint --fix",
"lint:types": "npm run lint:types --workspaces --if-present"
},
"workspaces": [
"packages/*"
Expand All @@ -16,15 +17,17 @@
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.{js,cjs}": [
"*.{js,cjs,ts,cts}": [
"eslint --fix"
]
},
"devDependencies": {
"@typescript-eslint/parser": "^8.47.0",
"c8": "^10.1.3",
"eslint": "^9.35.0",
"eslint-config-eslint": "^13.0.0",
"eslint-plugin-chai-friendly": "^1.0.0",
"eslint-plugin-expect-type": "^0.6.2",
"globals": "^16.0.0",
"lint-staged": "^15.2.0",
"mocha": "^11.1.0",
Expand Down
Loading