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

chore: migrate to ESLint v9 and relevant packages #362

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
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

146 changes: 0 additions & 146 deletions .eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ import { releaseItAction } from "release-it-action";

await releaseItAction({
branch: "main",
githubToken: process.env.GITHUB_TOKEN,
gitUserEmail: "your@email.com",
gitUserName: "YourUsername",
githubToken: process.env.GITHUB_TOKEN,
npmToken: process.env.NPM_TOKEN,
owner: "YourUsername",
repo: "your-repository",
Expand Down
3 changes: 2 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"npmjs",
"npmpackagejsonlintrc",
"outro",
"packagejson"
"packagejson",
"tseslint"
]
}
98 changes: 98 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import comments from "@eslint-community/eslint-plugin-eslint-comments/configs";
import eslint from "@eslint/js";
import vitest from "@vitest/eslint-plugin";
import jsdoc from "eslint-plugin-jsdoc";
import jsonc from "eslint-plugin-jsonc";
import markdown from "eslint-plugin-markdown";
import n from "eslint-plugin-n";
import packageJson from "eslint-plugin-package-json/configs/recommended";
import perfectionist from "eslint-plugin-perfectionist";
import * as regexp from "eslint-plugin-regexp";
import yml from "eslint-plugin-yml";
import tseslint from "typescript-eslint";

export default tseslint.config(
{
ignores: [
"**/*.snap",
"coverage",
"lib",
"node_modules",
"pnpm-lock.yaml",
"!.*",
"dist",
],
},
{ linterOptions: { reportUnusedDisableDirectives: "error" } },
eslint.configs.recommended,
comments.recommended,
jsdoc.configs["flat/contents-typescript-error"],
jsdoc.configs["flat/logical-typescript-error"],
jsdoc.configs["flat/stylistic-typescript-error"],
jsonc.configs["flat/recommended-with-json"],
markdown.configs.recommended,
n.configs["flat/recommended"],
packageJson,
perfectionist.configs["recommended-natural"],
regexp.configs["flat/recommended"],
{
extends: [
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
],
files: ["**/*.js", "**/*.ts"],
languageOptions: {
parserOptions: {
projectService: { allowDefaultProject: ["*.config.*s"] },
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// Stylistic concerns that don't interfere with Prettier
"logical-assignment-operators": [
"error",
"always",
{ enforceForIfStatements: true },
],
"n/no-missing-import": [
"error",
{
ignoreTypeImport: true,
},
],
"no-useless-rename": "error",
"object-shorthand": "error",
"operator-assignment": "error",
},
settings: { perfectionist: { partitionByComment: true, type: "natural" } },
},
{
extends: [tseslint.configs.disableTypeChecked],
files: ["**/*.md/*.ts"],
rules: {
"n/no-missing-import": ["error", { allowModules: ["release-it-action"] }],
},
},
{
extends: [vitest.configs.recommended],
files: ["**/*.test.*"],
rules: {
"@typescript-eslint/no-unsafe-assignment": "off",
},
},
{
extends: [yml.configs["flat/recommended"], yml.configs["flat/prettier"]],
files: ["**/*.{yml,yaml}"],
rules: {
"yml/file-extension": ["error", { extension: "yml" }],
"yml/sort-keys": [
"error",
{ order: { type: "asc" }, pathPattern: "^.*$" },
],
"yml/sort-sequence-values": [
"error",
{ order: { type: "asc" }, pathPattern: "^.*$" },
],
},
},
);
37 changes: 17 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"build": "tsc",
"build:release": "ncc build src/action/index.ts -o dist",
"format": "prettier \"**/*\" --ignore-unknown",
"lint": "eslint . .*js --max-warnings 0 --report-unused-disable-directives",
"lint": "eslint . --max-warnings 0",
"lint:knip": "knip",
"lint:md": "markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line",
"lint:package-json": "npmPkgJsonLint ./package.json",
Expand All @@ -44,29 +44,26 @@
"execa": "^8.0.1"
},
"devDependencies": {
"@octokit/types": "^13.0.0",
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
"@eslint/js": "^9.16.0",
"@octokit/types": "^13.6.2",
"@release-it/conventional-changelog": "^9.0.0",
"@types/eslint": "^8.44.3",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^8.0.0",
"@types/eslint-plugin-markdown": "^2.0.2",
"@vercel/ncc": "^0.38.0",
"@vitest/coverage-v8": "^0.34.6",
"@vitest/eslint-plugin": "^1.1.14",
"console-fail-test": "^0.5.0",
"cspell": "^8.0.0",
"eslint": "^8.50.0",
"eslint-plugin-deprecation": "^3.0.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-jsdoc": "^50.0.0",
"eslint-plugin-jsonc": "^2.9.0",
"eslint-plugin-markdown": "^3.0.1",
"eslint-plugin-n": "^17.0.0",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-perfectionist": "^2.1.0",
"eslint-plugin-regexp": "^2.0.0",
"eslint-plugin-vitest": "^0.4.0",
"eslint-plugin-yml": "^1.9.0",
"eslint": "^9.16.0",
"eslint-plugin-jsdoc": "^50.6.0",
"eslint-plugin-jsonc": "^2.18.2",
"eslint-plugin-markdown": "^5.1.0",
"eslint-plugin-n": "^17.14.0",
"eslint-plugin-package-json": "^0.18.0",
"eslint-plugin-perfectionist": "^4.2.0",
"eslint-plugin-regexp": "^2.7.0",
"eslint-plugin-yml": "^1.16.0",
"husky": "^9.0.0",
"jsonc-eslint-parser": "^2.3.0",
"knip": "^5.0.0",
"lint-staged": "^15.0.0",
"markdownlint": "^0.36.0",
Expand All @@ -80,8 +77,8 @@
"sentences-per-line": "^0.2.1",
"should-semantic-release": "^0.3.0",
"typescript": "^5.2.2",
"vitest": "^0.34.6",
"yaml-eslint-parser": "^1.2.2"
"typescript-eslint": "^8.17.0",
"vitest": "^0.34.6"
},
"packageManager": "pnpm@9.14.2",
"engines": {
Expand Down
Loading
Loading