Skip to content

Commit

Permalink
chore: get ESLint running again (#590)
Browse files Browse the repository at this point in the history
* chore: get ESLint running again

* add missing dependencies

* add missing dependencies

* Fixed up most lint:knip complaints

* release-it too, with a dedupe
  • Loading branch information
JoshuaKGoldberg authored Oct 10, 2024
1 parent 2b4f556 commit 5948b03
Show file tree
Hide file tree
Showing 13 changed files with 1,139 additions and 1,597 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

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

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/lint-package-json.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .npmpackagejsonlintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ npm i prettier-plugin-curly -D

You'll then be able to list it as a [Prettier plugin](https://prettier.io/docs/en/plugins.html) in your [Prettier config](https://prettier.io/docs/en/configuration.html):

```jsonc
```json
{
"plugins": ["prettier-plugin-curly"]
}
Expand Down
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"outro",
"packagejson",
"quickstart",
"tseslint",
"tsup",
"wontfix"
]
Expand Down
107 changes: 107 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import eslint from "@eslint/js";
import comments from "@eslint-community/eslint-plugin-eslint-comments/configs";
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: [
"coverage",
"eslint.config.mjs",
"lib",
"node_modules",
"pnpm-lock.yaml",
],
},
{
linterOptions: {
reportUnusedDisableDirectives: "error",
},
},
eslint.configs.recommended,
...jsonc.configs["flat/recommended-with-json"],
...markdown.configs.recommended,
...yml.configs["flat/recommended"],
...yml.configs["flat/prettier"],
comments.recommended,
jsdoc.configs["flat/contents-typescript-error"],
jsdoc.configs["flat/logical-typescript-error"],
jsdoc.configs["flat/stylistic-typescript-error"],
n.configs["flat/recommended"],
packageJson,
perfectionist.configs["recommended-natural"],
regexp.configs["flat/recommended"],
...tseslint.config({
extends: [
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
],
files: ["**/*.js", "**/*.ts"],
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ["*.config.*s"],
},
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// These off-by-default rules work well for this repo and we like them on.
"logical-assignment-operators": [
"error",
"always",
{ enforceForIfStatements: true },
],
"operator-assignment": "error",

// Stylistic concerns that don't interfere with Prettier
"no-useless-rename": "error",
"object-shorthand": "error",
},
}),
{
extends: [tseslint.configs.disableTypeChecked],
files: ["**/*.md/*.ts"],
rules: {
"n/no-missing-import": [
"error",
{ allowModules: ["create-typescript-app"] },
],
},
},
{
files: ["**/*.test.*"],
languageOptions: {
globals: vitest.environments.env.globals,
},
plugins: { vitest },
},
{
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: "^.*$",
},
],
},
},
);
File renamed without changes.
58 changes: 25 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@
"scripts": {
"build": "tsup",
"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 .",
"lint:packages": "pnpm dedupe --check",
"lint:spelling": "cspell \"**\" \".github/**/*\"",
"prepare": "husky",
Expand All @@ -54,45 +53,38 @@
},
"devDependencies": {
"@babel/types": "^7.22.5",
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
"@eslint/js": "^9.12.0",
"@release-it/conventional-changelog": "^8.0.0",
"@types/babel__generator": "^7.6.8",
"@types/babel__traverse": "^7.20.1",
"@types/eslint": "^8.44.3",
"@types/prettier": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"@vitest/coverage-v8": "^2.0.0",
"@vitest/eslint-plugin": "^1.1.7",
"console-fail-test": "^0.4.0",
"cspell": "^8.0.0",
"eslint": "^9.0.0",
"eslint-plugin-deprecation": "^3.0.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-jsdoc": "^48.0.0",
"eslint-plugin-jsonc": "^2.9.0",
"eslint-plugin-markdown": "^5.0.0",
"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.5.0",
"eslint-plugin-yml": "^1.9.0",
"husky": "^9.0.0",
"jsonc-eslint-parser": "^2.3.0",
"knip": "5.26.0",
"lint-staged": "^15.0.0",
"markdownlint": "^0.34.0",
"markdownlint-cli": "^0.41.0",
"npm-package-json-lint": "^8.0.0",
"npm-package-json-lint-config-default": "^7.0.0",
"prettier": "^3.0.3",
"prettier-plugin-packagejson": "^2.4.6",
"release-it": "^17.0.0",
"eslint": "^9.12.0",
"eslint-plugin-jsdoc": "^50.3.1",
"eslint-plugin-jsonc": "^2.16.0",
"eslint-plugin-markdown": "^5.1.0",
"eslint-plugin-n": "^17.11.1",
"eslint-plugin-package-json": "^0.15.3",
"eslint-plugin-perfectionist": "^3.8.0",
"eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-yml": "^1.14.0",
"husky": "^9.1.6",
"knip": "^5.33.3",
"lint-staged": "^15.2.10",
"markdownlint": "^0.35.0",
"markdownlint-cli": "^0.42.0",
"prettier": "^3.3.3",
"prettier-plugin-packagejson": "^2.5.3",
"release-it": "^17.8.2",
"sentences-per-line": "^0.2.1",
"should-semantic-release": "^0.3.0",
"tsup": "^8.0.0",
"typescript": "^5.2.2",
"vitest": "^2.0.0",
"yaml-eslint-parser": "^1.2.2"
"tsup": "^8.3.0",
"typescript": "^5.6.3",
"typescript-eslint": "^8.8.1",
"vitest": "^2.0.0"
},
"peerDependencies": {
"prettier": "^2 || ^3"
Expand Down
Loading

0 comments on commit 5948b03

Please sign in to comment.