Skip to content

Commit cbca651

Browse files
taneltmmrts
authored andcommitted
Updated dependencies and version bump to 2.4.0-rc1
WE2-1018 - All dependencies updated - Version bump to 2.4.0-rc1 - Version in package.json can now have a release candidate suffix which will be excluded in the extension manifest - Migrated `eslint` to the new flat config file format - The `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` packages are deprecated, changed to the new `typescript-eslint` package which contains both. - New dependency `@stylistic/eslint-plugin-ts` - Some linter rules have been deprecated or removed from the `typescript-eslint` project and migrated to `@stylistic`, for example the `semi` rule. - Fixed some minor linter errors - Added additional linter rule overrides. These rules should be checked separately and might require fixes in the code. - Renamed `rollup.config.js` to `rollup.config.mjs` as it was a ES6 module and not a CommonJS file - Removed `findFiles` from `build-utils.mjs`. It was a promise wrapper for `glob`. After updating `glob`, it now returns a promise by itself, so the wrapper was unnecessary. - Moved `bootstrap` from `devDependencies` to `dependencies`, which should now correctly reflect how it's used. Signed-off-by: Tanel Metsar <[email protected]>
1 parent 571918b commit cbca651

File tree

13 files changed

+3135
-2258
lines changed

13 files changed

+3135
-2258
lines changed

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
- uses: actions/setup-node@v4
1515
with:
16-
node-version: '16.x'
16+
node-version: '20.x'
1717

1818
- name: Cache Node.js modules
1919
uses: actions/cache@v4

eslint.config.mjs

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// @ts-check
2+
import globals from "globals";
3+
import eslint from "@eslint/js";
4+
import tseslint from "typescript-eslint";
5+
import stylisticTs from '@stylistic/eslint-plugin-ts';
6+
7+
export default tseslint.config(
8+
{
9+
extends: [
10+
eslint.configs.recommended,
11+
tseslint.configs.recommendedTypeChecked,
12+
tseslint.configs.stylisticTypeChecked,
13+
],
14+
15+
files: ["src/**/*.ts"],
16+
17+
ignores: [
18+
"bin/",
19+
"dist/",
20+
"lib/**/*",
21+
"**/__tests__/**/*"
22+
],
23+
24+
plugins: {
25+
'@stylistic/ts': stylisticTs,
26+
'@typescript-eslint': tseslint.plugin,
27+
},
28+
29+
languageOptions: {
30+
sourceType: "module",
31+
globals: {
32+
...globals.browser,
33+
...globals.node,
34+
...globals.es2021,
35+
...globals.webextensions,
36+
},
37+
parserOptions: {
38+
projectService: true,
39+
tsconfigRootDir: import.meta.dirname,
40+
},
41+
},
42+
43+
rules: {
44+
"quotes": "error",
45+
"key-spacing": ["error", { "align": "value" }],
46+
"comma-dangle": ["error", "only-multiline"],
47+
"object-curly-spacing": ["error", "always"],
48+
"array-bracket-spacing": "error",
49+
"indent": ["error", 2, { "SwitchCase": 1 }],
50+
"sort-imports": ["error", { allowSeparatedGroups: true }],
51+
52+
"@stylistic/ts/semi": "error",
53+
54+
"@typescript-eslint/array-type": ["error", { default: "generic" }],
55+
56+
// The following rules override the default "error" setting.
57+
// These cases should be investigated and the overrides
58+
// should either be removed or set to "off".
59+
"@typescript-eslint/no-explicit-any": "warn",
60+
"@typescript-eslint/no-floating-promises": "warn",
61+
"@typescript-eslint/no-unsafe-argument": "warn",
62+
"@typescript-eslint/no-unsafe-assignment": "warn",
63+
"@typescript-eslint/no-unsafe-member-access": "warn",
64+
"@typescript-eslint/no-unused-expressions": "warn",
65+
"@typescript-eslint/no-unsafe-return": "warn",
66+
"@typescript-eslint/no-unsafe-call": "warn",
67+
"@typescript-eslint/prefer-promise-reject-errors": "warn",
68+
"@typescript-eslint/prefer-regexp-exec": "warn",
69+
"@typescript-eslint/prefer-nullish-coalescing": "warn",
70+
"@typescript-eslint/consistent-type-definitions": "warn",
71+
"@typescript-eslint/no-misused-promises": "warn",
72+
"@typescript-eslint/dot-notation": "warn",
73+
"@typescript-eslint/restrict-plus-operands": "warn",
74+
},
75+
},
76+
);

jest.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
/* eslint-disable @typescript-eslint/no-var-requires */
21
const { pathsToModuleNameMapper } = require("ts-jest");
32
const { compilerOptions } = require("./tsconfig");
43

5-
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
64
module.exports = {
75
preset: "ts-jest",
86
testEnvironment: "node",

0 commit comments

Comments
 (0)