Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 107 additions & 8 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,112 @@
{
"root": true,
"extends": [
"semistandard",
"plugin:promise/recommended",
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"env": {
"node": true,
"mocha": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2019
},
"plugins": [
"@typescript-eslint",
"prettier"
],
"parser": "@typescript-eslint/parser",
"rules": {
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-empty-function": 0,
"no-return-assign": 0,
"space-before-function-paren": ["error", "never"]
}
}
"no-restricted-properties": [
"error",
{
"object": "describe",
"property": "only"
},
{
"object": "it",
"property": "only"
},
{
"object": "context",
"property": "only"
}
],
"prettier/prettier": "error",
"no-console": "error",
"valid-typeof": "error",
"eqeqeq": [
"error",
"always",
{
"null": "ignore"
}
],
"strict": [
"error",
"global"
],
"no-restricted-syntax": [
"error",
{
"selector": "TSEnumDeclaration",
"message": "Do not declare enums"
},
{
"selector": "BinaryExpression[operator=/[=!]==/] Identifier[name='undefined']",
"message": "Do not strictly check undefined"
},
{
"selector": "BinaryExpression[operator=/[=!]==/] Literal[raw='null']",
"message": "Do not strictly check null"
},
{
"selector": "BinaryExpression[operator=/[=!]==?/] Literal[value='undefined']",
"message": "Do not strictly check typeof undefined (NOTE: currently this rule only detects the usage of 'undefined' string literal so this could be a misfire)"
}
],
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
]
},
"overrides": [
{
"files": [
"lib/*.js"
],
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "commonjs"
}
},
{
"files": [
"test/**/*ts"
],
"rules": {
// chat `expect(..)` style chaining is considered
// an unused expression
"@typescript-eslint/no-unused-expressions": "off"
}
},
{
// json configuration files
"files": [
".*.json"
],
"rules": {
"@typescript-eslint/no-unused-expressions": "off"
}
}
]
}
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ updates:
versions: [">=16.0.0"]
# we ignore TS as a part of quarterly dependency updates.
- dependency-name: "typescript"
- dependency-name: "@types/node"
versions: [">=24.0.0"]
groups:
development-dependencies:
dependency-type: "development"
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on: [push, pull_request]

name: CI
permissions:
contents: read

jobs:
test:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Dependencies
run: npm install
- name: Lint
run: npm run lint
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
".esm-wrapper.mjs"
],
"scripts": {
"lint": "eslint \"{src,test}/**/*.ts\"",
"test": "npm run lint && npm run build && nyc mocha --colors -r ts-node/register test/*.ts",
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint \"{src,test}/**/*.ts\"",
"test": "npm run build && nyc mocha --colors -r ts-node/register test/*.ts",
"build": "npm run compile-ts && gen-esm-wrapper . ./.esm-wrapper.mjs",
"prepack": "npm run build",
"compile-ts": "tsc -p tsconfig.json"
Expand All @@ -39,16 +39,15 @@
"@types/chai": "^5.0.1",
"@types/mocha": "^10.0.10",
"@types/node": "^22.9.0",
"@typescript-eslint/eslint-plugin": "^4.2.0",
"@typescript-eslint/parser": "^4.2.0",
"@typescript-eslint/eslint-plugin": "^8.39.1",
"@typescript-eslint/parser": "^8.39.1",
"chai": "^4.2.0",
"eslint": "^7.9.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^14.1.1",
"eslint": "^9.33.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-standard": "^5.0.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"gen-esm-wrapper": "^1.1.3",
"mocha": "^11.0.1",
"nyc": "^15.1.0",
Expand All @@ -59,4 +58,4 @@
"@types/whatwg-url": "^13.0.0",
"whatwg-url": "^14.1.0 || ^13.0.0"
}
}
}
Loading
Loading