Skip to content

Commit b9a0a99

Browse files
authored
This PR Updates most of the dependencies, as a result some code had also been updated, here is a list of the highlights:
.eslintrc.js: The new eslint version requires the use of a flat file for configuration, so I moved the previous format to the new one. replaced toBeCalled with toHaveBeenCalledWith as former has been deprecated replaced toBeCalledWith with toHaveBeenCalledWith as former has been deprecated Updating module and target on tsconfig to ES2020 ES2022 Removed .eslintignore as usage in a single file is disallowed by new version of eslint, instead added ignorePattern in new config file Various fixes to get clean eslint run. Updates node minimal version to 22. Restrict some permissions on the runners
1 parent f651c7d commit b9a0a99

23 files changed

+14697
-13762
lines changed

.eslintignore

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

.eslintrc.js

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

.eslintrc.mjs

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
import js from '@eslint/js';
2+
import typescript from '@typescript-eslint/eslint-plugin';
3+
import typescriptParser from '@typescript-eslint/parser';
4+
import jsdoc from 'eslint-plugin-jsdoc';
5+
import preferArrow from 'eslint-plugin-prefer-arrow';
6+
import importPlugin from 'eslint-plugin-import';
7+
import globals from 'globals';
8+
9+
export default [
10+
js.configs.recommended,
11+
{
12+
files: ['**/*.{js,ts,tsx}'],
13+
ignores: [
14+
'**/*.test*',
15+
'**/test/**/*'
16+
],
17+
languageOptions: {
18+
parser: typescriptParser,
19+
parserOptions: {
20+
project: 'tsconfig.json',
21+
sourceType: 'module'
22+
},
23+
globals: {
24+
...globals.browser,
25+
...globals.node,
26+
...globals.es2022,
27+
}
28+
},
29+
plugins: {
30+
'@typescript-eslint': typescript,
31+
'jsdoc': jsdoc,
32+
'prefer-arrow': preferArrow,
33+
'import': importPlugin
34+
},
35+
rules: {
36+
// Apply TypeScript recommended rules manually
37+
...typescript.configs.recommended.rules,
38+
...typescript.configs['recommended-requiring-type-checking'].rules,
39+
40+
// Let TypeScript handle undefined variables
41+
'no-undef': 'off',
42+
43+
// syntax preferences
44+
'quotes': ['error', 'single', {'avoidEscape': true, 'allowTemplateLiterals': true}],
45+
'semi': 'error',
46+
'no-extra-semi': 'error',
47+
'comma-style': ['error', 'last'],
48+
'wrap-iife': ['error', 'inside'],
49+
'spaced-comment': ['error', 'always', {'markers': ['*']}],
50+
'eqeqeq': ['error'],
51+
'accessor-pairs': ['error', {'getWithoutSet': false, 'setWithoutGet': false}],
52+
'curly': 'error',
53+
'new-parens': 'error',
54+
'func-call-spacing': 'error',
55+
'arrow-parens': ['error', 'as-needed'],
56+
'eol-last': 'error',
57+
58+
// anti-patterns
59+
'no-caller': 'error',
60+
'no-cond-assign': 'error',
61+
'no-console': ['error', {'allow': ['assert', 'context', 'error', 'timeStamp', 'time', 'timeEnd', 'warn']}],
62+
'no-debugger': 'error',
63+
'no-dupe-keys': 'error',
64+
'no-duplicate-case': 'error',
65+
'no-else-return': ['error', {'allowElseIf': false}],
66+
'no-empty-character-class': 'error',
67+
'no-global-assign': 'error',
68+
'no-implied-eval': 'error',
69+
'no-labels': 'error',
70+
'no-multi-str': 'error',
71+
'no-new-object': 'error',
72+
'no-octal-escape': 'error',
73+
'no-self-compare': 'error',
74+
'no-shadow-restricted-names': 'error',
75+
'no-unreachable': 'error',
76+
'no-unsafe-negation': 'error',
77+
'no-var': 'error',
78+
'no-with': 'error',
79+
'prefer-const': 'error',
80+
'radix': 'error',
81+
'valid-typeof': 'error',
82+
'no-return-assign': ['error', 'always'],
83+
84+
// es2015 features
85+
'require-yield': 'error',
86+
'template-curly-spacing': ['error', 'never'],
87+
88+
// spacing details
89+
'space-infix-ops': 'error',
90+
'space-in-parens': ['error', 'never'],
91+
'space-before-function-paren': ['error', {'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always'}],
92+
'no-whitespace-before-property': 'error',
93+
'keyword-spacing': [
94+
'error', {
95+
'overrides': {
96+
'if': {'after': true},
97+
'else': {'after': true},
98+
'for': {'after': true},
99+
'while': {'after': true},
100+
'do': {'after': true},
101+
'switch': {'after': true},
102+
'return': {'after': true}
103+
}
104+
}
105+
],
106+
'arrow-spacing': ['error', {'after': true, 'before': true}],
107+
108+
// file whitespace
109+
'no-multiple-empty-lines': ['error', {'max': 2}],
110+
'no-mixed-spaces-and-tabs': 'error',
111+
'no-trailing-spaces': 'error',
112+
'linebreak-style': ['error', process.platform === 'win32' ? 'windows' : 'unix'],
113+
114+
// Disabled rules
115+
'indent': 'off',
116+
'brace-style': 'off',
117+
'key-spacing': 'off',
118+
'quote-props': 'off',
119+
'no-implicit-globals': 'off',
120+
121+
// TypeScript rules (overrides to the recommended configs)
122+
'@typescript-eslint/explicit-member-accessibility': 'off',
123+
'@typescript-eslint/no-explicit-any': 'error',
124+
'@typescript-eslint/restrict-template-expressions': 'off',
125+
'@typescript-eslint/no-unsafe-call': 'off',
126+
127+
// skiping variables that start with underscore
128+
'no-unused-vars': 'off', // Turn off for TypeScript files
129+
'@typescript-eslint/no-unused-vars': ['error', {'argsIgnorePattern': '^_', 'varsIgnorePattern': '^_'}],
130+
131+
// Import rules
132+
'import/no-default-export': 'error'
133+
}
134+
}
135+
];

.github/workflows/CI_linux.yml

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,40 @@
1-
name: CI_Integration_Linux
2-
3-
on:
4-
push:
5-
branches: [ "main" ]
6-
pull_request:
7-
branches: [ "main" ]
8-
9-
jobs:
10-
build:
11-
runs-on: ubuntu-latest
12-
13-
strategy:
14-
matrix:
15-
node-version: [18.x]
16-
17-
steps:
18-
- uses: actions/checkout@v3
19-
20-
- name: Configuring Git LF Settings
21-
run: |
22-
git config --global core.autocrlf false
23-
24-
- name: Use Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@v3
26-
with:
27-
node-version: ${{ matrix.node-version }}
28-
29-
- name: Build and Test
30-
run: |
31-
npm install
32-
npm run build-and-lint
33-
npm run test
34-
35-
- name: Creating .vsix
36-
run: |
37-
npm run package
1+
name: CI_Integration_Linux
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
node-version: [22.x]
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- name: Configuring Git LF Settings
24+
run: |
25+
git config --global core.autocrlf false
26+
27+
- name: Use Node.js ${{ matrix.node-version }}
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
32+
- name: Build and Test
33+
run: |
34+
npm install
35+
npm run build-and-lint
36+
npm run test
37+
38+
- name: Creating .vsix
39+
run: |
40+
npm run package

0 commit comments

Comments
 (0)