Skip to content

Commit 51c032d

Browse files
committed
chore: update eslint to v9
BREAKING CHANGE: eslint update to v9
1 parent dbe15bb commit 51c032d

22 files changed

+5962
-2892
lines changed

.eslintrc.cjs

-5
This file was deleted.

eslint.config.mjs

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// @ts-check
2+
import globals from 'globals';
3+
import importPlugin from 'eslint-plugin-import';
4+
import eslintTerrestris from '@terrestris/eslint-config-typescript';
5+
import eslint from '@eslint/js';
6+
import tsEslint from 'typescript-eslint';
7+
import stylisticEslint from '@stylistic/eslint-plugin'
8+
9+
export default tsEslint.config({
10+
extends: [
11+
eslint.configs.recommended,
12+
...tsEslint.configs.recommended,
13+
...tsEslint.configs.stylistic,
14+
importPlugin.flatConfigs.recommended
15+
],
16+
files: [
17+
'src/**/*.ts',
18+
'spec/**/*.spec.ts'
19+
],
20+
ignores: [
21+
'**/*.spec.ts',
22+
'**/dist/*.js',
23+
'**/jest/__mocks__/*.ts'
24+
],
25+
languageOptions: {
26+
ecmaVersion: 2022,
27+
globals: globals.browser,
28+
parserOptions: {
29+
project: true,
30+
tsconfigRootDir: import.meta.dirname
31+
},
32+
},
33+
plugins: {
34+
'@stylistic': stylisticEslint
35+
},
36+
rules: {
37+
...eslintTerrestris.rules,
38+
'@typescript-eslint/member-ordering': 'off',
39+
'@typescript-eslint/no-empty-object-type': 'off',
40+
'@typescript-eslint/no-unused-vars': 'warn',
41+
'@typescript-eslint/no-this-alias': 'warn',
42+
'@typescript-eslint/prefer-for-of': 'warn',
43+
'@typescript-eslint/no-unsafe-function-type': 'warn',
44+
'@typescript-eslint/no-empty-function': 'warn',
45+
'import/no-unresolved': 'off',
46+
'import/named': 'off',
47+
'import/order': ['warn', {
48+
groups: [
49+
'builtin',
50+
'external',
51+
'parent',
52+
'sibling',
53+
'index',
54+
'object'
55+
],
56+
pathGroups: [{
57+
pattern: 'react',
58+
group: 'external',
59+
position: 'before'
60+
}, {
61+
pattern: '@terrestris/**',
62+
group: 'external',
63+
position: 'after'
64+
}],
65+
pathGroupsExcludedImportTypes: ['react'],
66+
'newlines-between': 'always-and-inside-groups',
67+
alphabetize: {
68+
order: 'asc',
69+
caseInsensitive: true
70+
}
71+
}]
72+
}
73+
});

example/print-manager-v2-example.js

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ const registerPrintHandler = () => {
7070

7171
const onPrintClick = () => {
7272
printProvider?.print(true)?.catch(error => {
73-
// eslint-disable-next-line no-console
7473
console.log('Error while printing: ' + error);
7574
});
7675
};

example/print-manager-v3-example.js

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ function registerCancelPrintHandler() {
8181

8282
function onPrintClick() {
8383
printProvider?.print(true)?.catch(error => {
84-
// eslint-disable-next-line no-console
8584
console.log('Error while printing: ' + error);
8685
});
8786
}

0 commit comments

Comments
 (0)