Skip to content

Commit

Permalink
update supported versions (#218)
Browse files Browse the repository at this point in the history
* update supported versions
replace eslint config with a current one (buggy!)

* add final NL
  • Loading branch information
Idrinth authored Jan 25, 2025
1 parent 1f440ab commit 91d49cc
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 183 deletions.
178 changes: 0 additions & 178 deletions .eslintrc.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ jobs:
strategy:
matrix:
version:
- 20
- 21
- 22
- 23
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.version }}
Expand Down
171 changes: 171 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
import json from "eslint-plugin-json";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

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

export default [{
ignores: ["**/node_modules"],
}, ...compat.extends(
"eslint:recommended",
"plugin:json/recommended",
"plugin:@typescript-eslint/recommended",
), {
plugins: {
json,
},

languageOptions: {
globals: {
...globals.node,
},

parser: tsParser,
ecmaVersion: 2018,
sourceType: "commonjs",
},

rules: {
"no-await-in-loop": "error",
"no-extra-parens": "warn",
"no-template-curly-in-string": "error",
"class-methods-use-this": "error",
complexity: ["error", 5],
"consistent-return": "warn",
curly: "error",
"dot-notation": "warn",
eqeqeq: "error",
"guard-for-in": "error",
"no-alert": "error",
"no-caller": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "warn",
"no-extra-label": "warn",
"no-invalid-this": "error",
"no-magic-numbers": "warn",
"no-multi-spaces": "warn",
"no-new-wrappers": "error",
"no-new": "error",
"no-console": "warn",
"no-proto": "error",
"no-return-await": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-throw-literal": "error",
"no-unused-expressions": "warn",
"no-useless-call": "warn",
"no-useless-return": "warn",
radix: "error",
"require-await": "error",
"require-unicode-regexp": "error",
"wrap-iife": ["error", "inside"],
"no-shadow": "error",
"no-label-var": "error",
"no-undef-init": "error",
"no-undefined": "error",
"no-use-before-define": "error",
"func-call-spacing": ["warn", "never"],
"func-names": ["error", "never"],
"func-style": ["warn", "expression"],
"function-call-argument-newline": ["error", "consistent"],
"implicit-arrow-linebreak": ["warn", "beside"],

indent: ["warn", 2, {
SwitchCase: 1,
}],

"key-spacing": "warn",
"keyword-spacing": "warn",
"lines-between-class-members": ["warn", "always"],
"max-depth": "warn",

"max-len": ["warn", {
code: 80,
ignorePattern: "eslint",
}],

"max-params": "warn",
"newline-per-chained-call": "warn",
"new-parens": "error",
"no-array-constructor": "error",
"no-continue": "error",
"no-lonely-if": "error",
"no-multi-assign": "error",

"no-multiple-empty-lines": ["warn", {
max: 1,
}],

"no-nested-ternary": "error",
"no-new-object": "error",
"no-tabs": "warn",
"no-trailing-spaces": "warn",
"no-unneeded-ternary": "error",
"no-whitespace-before-property": "warn",

"object-curly-newline": ["warn", {
multiline: true,
minProperties: 1,
}],

"object-curly-spacing": ["warn", "always"],
"object-property-newline": "warn",
"one-var-declaration-per-line": ["error", "always"],
quotes: ["warn", "single"],
semi: "error",
"semi-spacing": "warn",
"semi-style": ["error", "last"],

"space-unary-ops": ["warn", {
words: true,
nonwords: true,
}],

"space-before-function-paren": ["warn", "never"],
"space-before-blocks": ["warn", "always"],

"switch-colon-spacing": ["warn", {
after: true,
before: false,
}],

"template-tag-spacing": ["warn", "always"],
"eol-last": ["warn", "always"],
"computed-property-spacing": ["warn", "never"],
"comma-style": ["warn", "last"],
"comma-spacing": "warn",
"comma-dangle": ["warn", "always"],
"block-spacing": ["warn", "always"],
"array-element-newline": "warn",
"brace-style": "warn",

"array-bracket-spacing": ["warn", "never", {
singleValue: true,
}],

"array-bracket-newline": ["warn", {
minItems: 2,
}],

"prefer-rest-params": "warn",
"template-curly-spacing": ["warn", "always"],
"prefer-const": "error",
"no-var": "error",
"no-useless-constructor": "warn",
"no-useless-computed-key": "warn",
"no-confusing-arrow": "warn",
"arrow-spacing": "warn",
"arrow-body-style": ["warn", "as-needed"],
},
}];
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
"iab": "bin/iab.js"
},
"scripts": {
"lint": "eslint . --ext .js,.ts,.cjs,.json,.tsx --report-unused-disable-directives --max-warnings 0",
"lint-fix": "eslint --fix . --ext .js,.ts,.cjs,.json",
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",
"lint-fix": "eslint --fix .",
"lint-md": "markdownlint *.md",
"test": "c8 mocha test",
"integration": "c8 mocha integration",
Expand All @@ -110,7 +110,7 @@
"mutation": "stryker run"
},
"engines": {
"node": ">=20"
"node": ">=22"
},
"engineStrict": true
}

0 comments on commit 91d49cc

Please sign in to comment.