Skip to content

Commit

Permalink
Update eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed Dec 9, 2024
1 parent f4851c1 commit b0c5af5
Show file tree
Hide file tree
Showing 7 changed files with 257 additions and 248 deletions.
50 changes: 0 additions & 50 deletions .eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion .ncurc.js → .ncurc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module.exports = {
target: (dependencyName, [{ semver, version, operator, major, minor, patch, release, build }]) => {
if (dependencyName === "@actions/http-client") return "patch"; // bloated via undici
if (dependencyName === "eslint") return "patch";
if (dependencyName === "semver") return "patch"; // Matching dep from @actions/*
if (dependencyName === "@types/semver") return "patch"; // Matching dep from @actions/*
if (dependencyName === "@types/node") return "minor";
Expand Down
76 changes: 76 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// @ts-check
import eslint from "@eslint/js";
import eslintPluginSimpleImportSort from "eslint-plugin-simple-import-sort";
import eslintPluginUnicorn from "eslint-plugin-unicorn";
import globals from "globals";
import tseslint from "typescript-eslint";

export default tseslint.config(
{
files: ["**/*.{ts,tsx,cts,mts,js,cjs,mjs}"],
},
{
ignores: [
"**/dist/**",
"**/node_modules/**",
"coverage/**",
],
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylistic,
eslintPluginUnicorn.configs["flat/recommended"],
{
languageOptions: {
parserOptions: {
warnOnUnsupportedTypeScriptVersion: false,
ecmaVersion: "latest",
sourceType: "module",
project: true,
},
globals: globals.node,
},
plugins: {
"simple-import-sort": eslintPluginSimpleImportSort,
},
},
{
"rules": {
"eqeqeq": "error",
"no-constant-condition": "off",
"no-inner-declarations": "off",
"no-undef": "off",
"no-unused-vars": "off", // Doesn't work in TS.
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/no-import-type-side-effects": "error",
"unicorn/catch-error-name": "off",
"unicorn/filename-case": "off",
"unicorn/no-await-expression-member": "off",
"unicorn/no-useless-undefined": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/switch-case-braces": "off",
"unicorn/no-empty-file": "off",
"unicorn/import-style": "off",
},
},
{
files: [
".ncurc.cjs",
"eslint.config.mjs",
],
extends: [tseslint.configs.disableTypeChecked],
},
);
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@
"@types/semver": "^6.2.7",
"@types/shell-quote": "^1.7.5",
"@types/which": "^3.0.4",
"@typescript-eslint/eslint-plugin": "^8.17.0",
"@typescript-eslint/parser": "^8.17.0",
"@vitest/coverage-v8": "^2.1.8",
"dprint": "^0.47.6",
"esbuild": "^0.24.0",
"eslint": "^8.57.1",
"eslint": "^9.16.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-unicorn": "^56.0.1",
"globals": "^15.13.0",
"husky": "^9.1.7",
"jest-serializer-path": "^0.1.15",
"klona": "^2.0.6",
"rimraf": "^6.0.1",
"typescript": "~5.7.2",
"typescript-eslint": "^8.17.0",
"vitest": "^2.1.8"
},
"overrides": {
Expand Down
Loading

0 comments on commit b0c5af5

Please sign in to comment.