Skip to content

Commit

Permalink
Upgrade TypeScript and ESLint
Browse files Browse the repository at this point in the history
Existing eslint config was not compatible with ESLint v8.
Pulled in various good plugins and recommended configs, instead.
  • Loading branch information
mcous committed Apr 13, 2023
1 parent ced66db commit 136b575
Show file tree
Hide file tree
Showing 12 changed files with 4,159 additions and 906 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
coverage
dist
lib
73 changes: 68 additions & 5 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,75 @@
# ESLint config
# http://eslint.org/docs/user-guide/configuring
# https://jstools.dev/eslint-config/

root: true

extends:
- "@jsdevtools"
- "eslint:recommended"
- "plugin:@typescript-eslint/recommended"
- "plugin:@typescript-eslint/recommended-requiring-type-checking"
- "plugin:@typescript-eslint/strict"
- "plugin:import/recommended"
- "plugin:import/typescript"
- "plugin:jsdoc/recommended-typescript"
- "plugin:n/recommended"
- "plugin:promise/recommended"
- "plugin:sonarjs/recommended"
- "plugin:unicorn/recommended"
- "prettier"

parserOptions:
project:
- "tsconfig.eslint.json"

settings:
import/resolver:
typescript: true
node: true

env:
es2021: true
node: true

overrides:
- files: ["**/*.js"]
rules:
"@typescript-eslint/no-var-requires": "off"
"unicorn/prefer-module": "off"

- files: ["test/**/*"]
env:
mocha: true
rules:
sonarjs/no-duplicate-string: "off"

rules:
n/no-unpublished-import: ["error", { "allowModules": ["@actions/core"] }]

# temporary rule overrides
# TODO(mc, 2023-04-12): fix problems, remove overrides, and remove --quiet
prefer-const: "warn"
no-regex-spaces: "warn"
"@typescript-eslint/no-floating-promises": "warn"
"@typescript-eslint/no-unsafe-argument": "warn"
"@typescript-eslint/no-unsafe-assignment": "warn"
"@typescript-eslint/no-unsafe-call": "warn"
"@typescript-eslint/no-unsafe-member-access": "warn"
"@typescript-eslint/no-unsafe-return": "warn"
"@typescript-eslint/require-await": "warn"
"@typescript-eslint/restrict-plus-operands": "warn"
"@typescript-eslint/restrict-template-expressions": "warn"
"@typescript-eslint/unbound-method": "warn"
n/no-missing-import: "warn"
n/no-missing-require: "warn"
n/no-process-exit: "warn"
unicorn/better-regex: "warn"
unicorn/catch-error-name: "warn"
unicorn/import-style: "warn"
unicorn/no-array-push-push: "warn"
unicorn/no-process-exit: "warn"
unicorn/no-useless-undefined: "warn"
unicorn/prefer-export-from: "warn"
unicorn/prefer-module: "warn"
unicorn/prefer-node-protocol: "warn"
unicorn/prefer-optional-catch-binding: "warn"
unicorn/prefer-spread: "warn"
unicorn/prefer-top-level-await: "warn"
unicorn/prevent-abbreviations: "warn"
unicorn/text-encoding-identifier-case: "warn"
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
coverage
dist
lib
package-lock.json
Loading

0 comments on commit 136b575

Please sign in to comment.