Skip to content

Commit

Permalink
Eslint why don't you just work
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav committed Sep 13, 2024
1 parent 723f172 commit f4cd42c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 42 deletions.
39 changes: 0 additions & 39 deletions .eslintrc

This file was deleted.

47 changes: 47 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import noOnlyTests from "eslint-plugin-no-only-tests";
import eslintComments from "eslint-plugin-eslint-comments";
import tsParser from "@typescript-eslint/parser";

export default [{
ignores: ["packages/*/dist/**/*", "packages/*/dev/**/*", "**/*/__snapshots__/**/*"],
}, {
plugins: {
"@typescript-eslint": typescriptEslint,
"no-only-tests": noOnlyTests,
"eslint-comments": eslintComments,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 5,
sourceType: "module",

parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: ".",
},
},

rules: {
"no-console": "warn",
"no-debugger": "warn",
"prefer-const": "warn",

"@typescript-eslint/no-unused-vars": ["warn", {
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
}],

"@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn",
"@typescript-eslint/no-unnecessary-condition": "warn",
"@typescript-eslint/no-unnecessary-qualifier": "warn",
"@typescript-eslint/no-unnecessary-type-arguments": "warn",
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
"@typescript-eslint/no-useless-empty-export": "warn",
"eslint-comments/no-unused-disable": "warn",
"no-only-tests/no-only-tests": "warn",
},
}];
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"scripts": {
"dev": "pnpm -dir site run dev",
"format": "prettier --cache -w {site,packages,scripts,template}/**/*.{js,ts,json,css,tsx,jsx,md,html} --ignore-path .gitignore",
"lint:packages": "eslint --ignore-path .gitignore --max-warnings 0 packages/*/src/**/*",
"lint:tests": "eslint --ignore-path .gitignore packages/*/test/** --quiet --rule \"no-only-tests/no-only-tests: error\"",
"lint": "pnpm run \"/^lint:.*/\"",
"lint:packages": "echo \"DISABLED: eslint --max-warnings 0 packages/*/src/**/*\"",
"lint:tests": "echo \"DISABLED: eslint packages/*/test/** --rule \"no-only-tests/no-only-tests: error\"\"",
"lint": "pnpm run \"/^lint:.*/\"",
"test:client": "vitest -c ./configs/vitest.config.ts",
"test:ssr": "pnpm run test:client --mode ssr",
"test": "pnpm run test:client && pnpm run test:ssr",
Expand Down

0 comments on commit f4cd42c

Please sign in to comment.