Skip to content

Commit

Permalink
Updating dependencies and required node version (#462)
Browse files Browse the repository at this point in the history
* upgrade workflows

* upgrade node version of package-lock check

* don't need to check out everything

* audit fix

* upgrade to node 18 or 20, fix up linting

* update package-lock

* upgrade prettier related packages

* apply new prettier formatting

* rm @typescript-eslint/array-type

* rm @typescript-eslint/prefer-for-of

* rm @typescript-eslint/prefer-nullish-coalescing

* rm @typescript-eslint/prefer-optional-chain

* rm @typescript-eslint/consistent-indexed-object-style

* update lint rules

* move eslintrc to js

* upgrade jsdoc plugin

* fix docs

* rm @typescript-eslint/no-floating-promises

* remove unused rules

* changelog
  • Loading branch information
bkendall committed Jan 3, 2024
1 parent 904b6a4 commit 9630950
Show file tree
Hide file tree
Showing 36 changed files with 1,533 additions and 6,338 deletions.
70 changes: 70 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
module.exports = {
root: true,
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:jsdoc/recommended",
"google",
"plugin:prettier/recommended",
],
env: {
es6: true,
node: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
sourceType: "module",
ecmaVersion: "ES2020",
project: ["tsconfig.json", "tsconfig.dev.json"],
},
plugins: ["@typescript-eslint", "jsdoc"],
rules: {
"jsdoc/newline-after-description": "off",
"jsdoc/require-jsdoc": ["warn", { publicOnly: true }],
"jsdoc/require-param-type": "off",
"jsdoc/require-returns-type": "off",

"require-atomic-updates": "off", // This rule is so noisy and isn't useful: https://github.com/eslint/eslint/issues/11899
"require-jsdoc": "off", // This rule is deprecated and superseded by jsdoc/require-jsdoc.
"valid-jsdoc": "off", // This is deprecated but included in recommended configs.
},
overrides: [
{
files: ["*.ts"],
rules: {
"@typescript-eslint/no-explicit-any": "warn", // TODO(bkendall): remove allow to error.
"@typescript-eslint/no-unsafe-argument": "warn", // TODO(bkendall): remove allow to error.
"@typescript-eslint/no-unsafe-assignment": "warn", // TODO(bkendall): remove allow to error.
"@typescript-eslint/no-unsafe-call": "warn", // TODO(bkendall): remove allow to error.
"@typescript-eslint/no-unsafe-member-access": "warn", // TODO(bkendall): remove allow to error.
},
},
{
files: ["*.js"],
rules: {
"@typescript-eslint/no-this-alias": "warn", // TODO(bkendall): remove allow to error.
"@typescript-eslint/no-unsafe-argument": "warn", // TODO(bkendall): remove allow to error.
"@typescript-eslint/no-unsafe-assignment": "warn", // TODO(bkendall): remove allow to error.
"@typescript-eslint/no-unsafe-call": "warn", // TODO(bkendall): remove allow to error.
"@typescript-eslint/no-unsafe-member-access": "warn", // TODO(bkendall): remove allow to error.
"@typescript-eslint/no-unsafe-return": "warn", // TODO(bkendall): remove allow to error.
"@typescript-eslint/no-var-requires": "warn", // TODO(bkendall): remove allow to error.
"@typescript-eslint/unbound-method": "warn", // TODO(bkendall): remove allow to error.
},
},
{
files: ["*.spec.*"],
env: {
mocha: true,
},
},
],
settings: {
jsdoc: {
tagNamePreference: {
returns: "return",
},
},
},
};
63 changes: 0 additions & 63 deletions .eslintrc.yaml

This file was deleted.

21 changes: 8 additions & 13 deletions .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ jobs:
check-license:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "^1.18.0"
- run: go install github.com/google/addlicense@latest
Expand All @@ -22,18 +20,16 @@ jobs:
strategy:
matrix:
node-version:
- "14"
- "16"
- "18"
- "20"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: package-lock.json

- run: npm i -g npm@8.16
- run: npm ci
- run: npm test
- run: npm outdated
Expand All @@ -43,13 +39,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "16"
node-version: "20"
cache: npm
cache-dependency-path: package-lock.json

- run: npm i -g npm@8.16
- run: npm install --package-lock-only --ignore-scripts
- run: "git diff --exit-code -- package-lock.json || (echo 'Error: package-lock.json is changed during npm install! Please make sure to use npm >= 6.9.0 and commit package-lock.json.' && false)"
2 changes: 1 addition & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@

* **BREAKING:** Requires Node.js >= 18.0.0.

0 comments on commit 9630950

Please sign in to comment.