Skip to content

Commit

Permalink
Updated dependencies and version bump to 2.4.0-rc1
Browse files Browse the repository at this point in the history
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 <taneltm@users.noreply.github.com>
  • Loading branch information
taneltm authored and mrts committed Jan 10, 2025
1 parent 571918b commit cbca651
Show file tree
Hide file tree
Showing 13 changed files with 3,135 additions and 2,258 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

31 changes: 0 additions & 31 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

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

- name: Cache Node.js modules
uses: actions/cache@v4
Expand Down
76 changes: 76 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// @ts-check
import globals from "globals";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import stylisticTs from '@stylistic/eslint-plugin-ts';

export default tseslint.config(
{
extends: [
eslint.configs.recommended,
tseslint.configs.recommendedTypeChecked,
tseslint.configs.stylisticTypeChecked,
],

files: ["src/**/*.ts"],

ignores: [
"bin/",
"dist/",
"lib/**/*",
"**/__tests__/**/*"
],

plugins: {
'@stylistic/ts': stylisticTs,
'@typescript-eslint': tseslint.plugin,
},

languageOptions: {
sourceType: "module",
globals: {
...globals.browser,
...globals.node,
...globals.es2021,
...globals.webextensions,
},
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},

rules: {
"quotes": "error",
"key-spacing": ["error", { "align": "value" }],
"comma-dangle": ["error", "only-multiline"],
"object-curly-spacing": ["error", "always"],
"array-bracket-spacing": "error",
"indent": ["error", 2, { "SwitchCase": 1 }],
"sort-imports": ["error", { allowSeparatedGroups: true }],

"@stylistic/ts/semi": "error",

"@typescript-eslint/array-type": ["error", { default: "generic" }],

// The following rules override the default "error" setting.
// These cases should be investigated and the overrides
// should either be removed or set to "off".
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/prefer-promise-reject-errors": "warn",
"@typescript-eslint/prefer-regexp-exec": "warn",
"@typescript-eslint/prefer-nullish-coalescing": "warn",
"@typescript-eslint/consistent-type-definitions": "warn",
"@typescript-eslint/no-misused-promises": "warn",
"@typescript-eslint/dot-notation": "warn",
"@typescript-eslint/restrict-plus-operands": "warn",
},
},
);
2 changes: 0 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const { pathsToModuleNameMapper } = require("ts-jest");
const { compilerOptions } = require("./tsconfig");

/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
Expand Down
Loading

0 comments on commit cbca651

Please sign in to comment.