Skip to content

Commit

Permalink
chore: 🤖 update eslint v8 to v9
Browse files Browse the repository at this point in the history
  • Loading branch information
sweatpotato13 committed Jul 30, 2024
1 parent cfea41a commit 98b46c8
Show file tree
Hide file tree
Showing 7 changed files with 509 additions and 1,475 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

39 changes: 0 additions & 39 deletions .eslintrc.js

This file was deleted.

5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
yarn lint-staged
65 changes: 65 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { FlatCompat } from "@eslint/eslintrc";
import eslintJs from "@eslint/js";
import pluginSecurity from "eslint-plugin-security";
import simpleImportSortPlugin from "eslint-plugin-simple-import-sort";
import globals from "globals";
import path from "path";
import eslintTs from "typescript-eslint";
import tseslint from "typescript-eslint";
import { fileURLToPath } from "url";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: eslintJs.configs.recommended
});

export default eslintTs.config(
eslintJs.configs.recommended,
...eslintTs.configs.recommendedTypeChecked,
...compat.extends(
"prettier"
),
{
ignores: ["**/types.d.ts", "**/*.js", "**/node_modules/"]
},
{
languageOptions: {
globals: {
...globals.es2020,
...globals.node,
Atomics: "readonly",
SharedArrayBuffer: "readonly"
},
parserOptions: {
project: "tsconfig.json"
}
},
settings: {
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"]
}
}
},

plugins: {
"@typescript-eslint": tseslint.plugin,
"simple-import-sort": simpleImportSortPlugin,
security: pluginSecurity.configs.recommended,
},
rules: {
"no-empty-pattern": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-explicit-any": "off",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
semi: "error"
}
}
);
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
"prettier": "prettier --write --config .prettierrc \"{src,test}/**/*.ts\"",
"build": "tsc",
"prebuild": "rimraf ./dist",
"preinstall": "husky install",
"pre-commit": "lint-staged"
"install": "husky init",
"pre-commit": "lint-staged",
"prepare": "husky"
},
"lint-staged": {
"*.{ts,tsx,js,jsx}": [
Expand All @@ -40,27 +41,26 @@
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@swc/core": "1.5.25",
"@swc/helpers": "^0.5.11",
"@eslint/js": "^9.8.0",
"@swc/core": "1.7.3",
"@swc/helpers": "^0.5.12",
"@types/eslint__js": "^8.42.3",
"@types/jest": "29.5.12",
"@types/node": "^20.14.2",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"eslint": "8.56.0",
"@types/node": "^22.0.0",
"eslint": "^9.8.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-security": "^3.0.0",
"eslint-plugin-simple-import-sort": "^12.1.0",
"husky": "9.0.11",
"eslint-plugin-security": "^3.0.1",
"eslint-plugin-simple-import-sort": "^12.1.1",
"husky": "9.1.4",
"jest": "29.7.0",
"lint-staged": "^15.2.5",
"prettier": "^3.3.1",
"rimraf": "^5.0.7",
"ts-jest": "29.1.4",
"lint-staged": "^15.2.7",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"ts-jest": "29.2.3",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
"typescript": "^5.4.5"
"typescript": "5.4.5",
"typescript-eslint": "8.0.0-alpha.10"
},
"packageManager": "[email protected]"
}
2 changes: 1 addition & 1 deletion test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe("1+1 Test", () => {
test("1+1 is 2", async () => {
test("1+1 is 2", () => {
expect(1 + 1).toBe(2);
});
});
Loading

0 comments on commit 98b46c8

Please sign in to comment.