Skip to content
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

refactor!: update to eslint v9 #16

Merged
merged 12 commits into from
Apr 14, 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/serious-hats-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@masknet/eslint-plugin": minor
---

upgrade to eslint 9
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

34 changes: 28 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,23 @@
"plugin:@typescript-eslint/recommended",
"prettier"
],
"env": { "node": true },
"ignorePatterns": ["lib/**/*", "vitest.config.ts", "estree.tsx"],
"env": {
"node": true
},
"overrides": [
{ "files": ["src/**/*.spec.ts"], "env": { "mocha": true } },
{ "files": ["src/scripts/**/*.ts"], "rules": { "node/shebang": "off" } }
{
"files": ["src/**/*.spec.ts"],
"env": {
"mocha": true
}
},
{
"files": ["src/scripts/**/*.ts"],
"rules": {
"node/shebang": "off"
}
}
],
"rules": {
"constructor-super": "error",
Expand Down Expand Up @@ -70,9 +83,18 @@
"error",
{
"paths": [
{ "name": "@typescript-eslint/types/dist/generated/ast-spec", "allowTypeImports": true },
{ "name": "@typescript-eslint/utils/dist/ast-utils", "allowTypeImports": true },
{ "name": "@typescript-eslint/utils/dist/ts-eslint", "allowTypeImports": true }
{
"name": "@typescript-eslint/types/dist/generated/ast-spec",
"allowTypeImports": true
},
{
"name": "@typescript-eslint/utils/dist/ast-utils",
"allowTypeImports": true
},
{
"name": "@typescript-eslint/utils/dist/ts-eslint",
"allowTypeImports": true
}
]
}
]
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,40 @@ on:

jobs:
prettier:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: "19"
- run: pnpx prettier --check .
node-version: "21"
- run: pnpx prettier --check src tests configs
markdownlint:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: "19"
node-version: "21"
- run: pnpx markdownlint-cli .
spellcheck:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: "19"
node-version: "21"
- run: pnpx cspell lint --relative --no-progress '**'
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: "19"
node-version: "21"
cache: "pnpm"
- run: pnpm install
- run: pnpm run lint
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,28 @@ on:

jobs:
publish:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: "19"
cache: "pnpm"
- run: pnpm install
- run: pnpm run generate
- run: npx tsc -b
- run: npm install -g npm
- run: pnpm --package=typescript dlx tsc -b
- uses: changesets/action@v1
with:
title: "ci: draft a new release"
commit: "ci: draft a new release"
publish: npx changeset publish
publish: pnpx @changesets/cli publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
33 changes: 17 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
],
"scripts": {
"generate": "node --loader ts-node/esm/transpile-only ./src/scripts/generate/index.ts",
"lint": "eslint . --fix",
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint . --fix",
"markdownlint": "markdownlint .",
"prepare": "husky install",
"spellcheck": "cspell lint --relative --no-progress '**'",
Expand All @@ -55,32 +55,33 @@
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@commitlint/config-conventional": "^18.6.0",
"@commitlint/config-conventional": "^19.2.2",
"@masknet/config": "^0.2.1",
"@types/glob": "^8.1.0",
"@types/prettier": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@typescript-eslint/types": "^6.21.0",
"@typescript-eslint/utils": "^6.21.0",
"commitlint": "^18.6.0",
"cspell": "^8.3.2",
"eslint": "^8.56.0",
"@typescript-eslint/eslint-plugin": "^7.6.0",
"@typescript-eslint/parser": "^7.6.0",
"@typescript-eslint/types": "^7.6.0",
"@typescript-eslint/utils": "^7.6.0",
"commitlint": "^19.2.2",
"cspell": "^8.7.0",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-eslint-plugin": "^5.3.0",
"eslint-plugin-eslint-plugin": "^6.0.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-unicorn": "^51.0.1",
"eslint-plugin-unused-imports": "^3.0.0",
"glob": "^10.3.10",
"husky": "^9.0.10",
"eslint-plugin-unicorn": "^52.0.0",
"eslint-plugin-unused-imports": "^3.1.0",
"glob": "^10.3.12",
"globals": "^15.0.0",
"husky": "^9.0.11",
"json-schema-to-typescript": "^13.1.2",
"lint-staged": "^15.2.2",
"markdownlint-cli": "^0.39.0",
"prettier": "^3.2.5",
"ts-dedent": "^2.2.0",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"vitest": "^1.2.2"
"typescript": "^5.4.5",
"vitest": "^1.5.0"
},
"peerDependencies": {
"eslint": ">= 8"
Expand Down
Loading
Loading