@eclipse-scout/eslint-config 25.2.20 → 26.1.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +13 -11
- package/src/common.mjs +78 -0
- package/src/index.mjs +53 -0
- package/src/common.js +0 -90
- package/src/index.js +0 -48
package/README.md
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<a href="https://ci.eclipse.org/scout/job/scout-integration-
|
|
7
|
-
<a href="https://ci.eclipse.org/scout/job/scout-integration-
|
|
6
|
+
<a href="https://ci.eclipse.org/scout/job/scout-integration-26.1-RT-nightly_pipeline/" target="_blank" rel="noopener noreferrer"><img alt="Jenkins" src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.eclipse.org%2Fscout%2Fjob%2Fscout-integration-25.2-RT-nightly_pipeline%2F"></a>
|
|
7
|
+
<a href="https://ci.eclipse.org/scout/job/scout-integration-26.1-RT-nightly_pipeline/" target="_blank" rel="noopener noreferrer"><img alt="Jenkins tests" src="https://img.shields.io/jenkins/tests?jobUrl=https%3A%2F%2Fci.eclipse.org%2Fscout%2Fjob%2Fscout-integration-25.2-RT-nightly_pipeline%2F"></a>
|
|
8
8
|
<a href="https://www.npmjs.com/package/@eclipse-scout/eslint-config" target="_blank" rel="noopener noreferrer"><img alt="npm" src="https://img.shields.io/npm/dm/@eclipse-scout/eslint-config"></a>
|
|
9
9
|
<a href="https://www.eclipse.org/legal/epl-2.0/" target="_blank" rel="noopener noreferrer"><img alt="NPM" src="https://img.shields.io/npm/l/@eclipse-scout/eslint-config"></a>
|
|
10
10
|
<a href="https://www.npmjs.com/package/@eclipse-scout/eslint-config" target="_blank" rel="noopener noreferrer"><img alt="npm (scoped)" src="https://img.shields.io/npm/v/@eclipse-scout/eslint-config"></a>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-scout/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "26.1.0-beta.4",
|
|
4
4
|
"description": "ESLint shareable config for the Scout style",
|
|
5
5
|
"author": "BSI Business Systems Integration AG",
|
|
6
6
|
"homepage": "https://eclipse.dev/scout/",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
},
|
|
11
11
|
"license": "EPL-2.0",
|
|
12
12
|
"engines": {
|
|
13
|
-
"node": ">=
|
|
14
|
-
"npm": ">=
|
|
15
|
-
"pnpm": ">=
|
|
13
|
+
"node": ">=24.12.0",
|
|
14
|
+
"npm": ">=11.6.2",
|
|
15
|
+
"pnpm": ">=10.26.1"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|
|
18
18
|
"scout",
|
|
@@ -34,21 +34,23 @@
|
|
|
34
34
|
"enforce",
|
|
35
35
|
"hint"
|
|
36
36
|
],
|
|
37
|
-
"main": "src/index.
|
|
37
|
+
"main": "src/index.mjs",
|
|
38
38
|
"files": [
|
|
39
39
|
"src"
|
|
40
40
|
],
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@eclipse-scout/releng": "^
|
|
43
|
-
"eslint": "
|
|
42
|
+
"@eclipse-scout/releng": "^26.1.0",
|
|
43
|
+
"eslint": "9.39.2",
|
|
44
|
+
"@eslint/js": "9.39.2",
|
|
45
|
+
"globals": "16.5.0"
|
|
44
46
|
},
|
|
45
47
|
"dependencies": {
|
|
46
|
-
"typescript": "5.
|
|
47
|
-
"
|
|
48
|
-
"@
|
|
48
|
+
"typescript": "5.9.3",
|
|
49
|
+
"typescript-eslint": "8.50.1",
|
|
50
|
+
"@stylistic/eslint-plugin": "5.6.1"
|
|
49
51
|
},
|
|
50
52
|
"peerDependencies": {
|
|
51
|
-
"eslint": ">=
|
|
53
|
+
"eslint": ">=9.39.2"
|
|
52
54
|
},
|
|
53
55
|
"scripts": {
|
|
54
56
|
"cleanup:snapshots": "releng-scripts cleanup:snapshots",
|
package/src/common.mjs
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2010, 2026 BSI Business Systems Integration AG
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
*/
|
|
10
|
+
import {defineConfig} from 'eslint/config';
|
|
11
|
+
import stylistic from '@stylistic/eslint-plugin';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Contains additional rules that are not part of the eslint recommended config and adjusts some of the rules.
|
|
15
|
+
*/
|
|
16
|
+
export default defineConfig({
|
|
17
|
+
plugins: {
|
|
18
|
+
'@stylistic': stylistic
|
|
19
|
+
},
|
|
20
|
+
rules: {
|
|
21
|
+
'accessor-pairs': 'warn',
|
|
22
|
+
'array-callback-return': 'error',
|
|
23
|
+
'no-alert': 'warn',
|
|
24
|
+
'no-eval': 'error',
|
|
25
|
+
'no-extra-bind': 'error',
|
|
26
|
+
'no-extra-label': 'error',
|
|
27
|
+
'no-implied-eval': 'error',
|
|
28
|
+
'no-iterator': 'error',
|
|
29
|
+
'no-caller': 'warn',
|
|
30
|
+
'no-labels': 'error',
|
|
31
|
+
'no-undef': 'off',
|
|
32
|
+
'camelcase': ['error', {allow: ['^\\$', '_']}],
|
|
33
|
+
'no-lone-blocks': 'error',
|
|
34
|
+
'no-loop-func': 'error',
|
|
35
|
+
'no-proto': 'error',
|
|
36
|
+
'no-prototype-builtins': 'off',
|
|
37
|
+
'no-return-assign': 'error',
|
|
38
|
+
'no-self-compare': 'error',
|
|
39
|
+
'no-label-var': 'error',
|
|
40
|
+
'no-var': 'warn',
|
|
41
|
+
'no-sequences': 'error',
|
|
42
|
+
'no-unmodified-loop-condition': 'error',
|
|
43
|
+
'no-useless-return': 'error',
|
|
44
|
+
'no-else-return': 'error',
|
|
45
|
+
'arrow-parens': ['error', 'as-needed'],
|
|
46
|
+
'no-duplicate-imports': 'error',
|
|
47
|
+
'prefer-arrow-callback': 'warn',
|
|
48
|
+
'new-cap': ['error', {'capIsNewExceptions': ['Deferred', '$.Event'], 'capIsNewExceptionPattern': 'Model$'}],
|
|
49
|
+
'no-multi-assign': 'error',
|
|
50
|
+
'no-unused-vars': 'off',
|
|
51
|
+
'curly': ['error', 'all'],
|
|
52
|
+
'eqeqeq': ['error', 'always', {'null': 'ignore'}],
|
|
53
|
+
'prefer-rest-params': 'warn',
|
|
54
|
+
'prefer-spread': 'warn',
|
|
55
|
+
'@stylistic/no-multi-spaces': 'warn',
|
|
56
|
+
'@stylistic/eol-last': ['warn', 'always'],
|
|
57
|
+
'@stylistic/comma-spacing': ['warn', {'before': false, 'after': true}],
|
|
58
|
+
'@stylistic/array-bracket-spacing': ['warn', 'never'],
|
|
59
|
+
'@stylistic/brace-style': ['warn', '1tbs'],
|
|
60
|
+
'@stylistic/computed-property-spacing': ['warn', 'never'],
|
|
61
|
+
'@stylistic/max-len': ['warn', 240, 2, {ignoreUrls: true, ignorePattern: '^import .*'}],
|
|
62
|
+
'@stylistic/semi': ['warn', 'always'],
|
|
63
|
+
'@stylistic/quotes': ['warn', 'single'],
|
|
64
|
+
'@stylistic/comma-dangle': ['warn', 'never'],
|
|
65
|
+
'@stylistic/object-curly-spacing': ['warn', 'never'],
|
|
66
|
+
'@stylistic/arrow-spacing': 'warn',
|
|
67
|
+
'@stylistic/template-curly-spacing': ['warn', 'never'],
|
|
68
|
+
'@stylistic/linebreak-style': ['warn', 'unix'],
|
|
69
|
+
'@stylistic/no-trailing-spaces': 'warn',
|
|
70
|
+
'@stylistic/space-before-function-paren': ['warn', {
|
|
71
|
+
'anonymous': 'never',
|
|
72
|
+
'named': 'never',
|
|
73
|
+
'asyncArrow': 'always'
|
|
74
|
+
}],
|
|
75
|
+
'@stylistic/indent': ['warn', 2, {'SwitchCase': 1}],
|
|
76
|
+
'@stylistic/spaced-comment': ['warn', 'always', {'exceptions': ['*']}]
|
|
77
|
+
}
|
|
78
|
+
});
|
package/src/index.mjs
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2010, 2026 BSI Business Systems Integration AG
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
*/
|
|
10
|
+
import globals from 'globals';
|
|
11
|
+
import eslint from '@eslint/js';
|
|
12
|
+
import {defineConfig} from 'eslint/config';
|
|
13
|
+
import tseslint from 'typescript-eslint';
|
|
14
|
+
import common from './common.mjs';
|
|
15
|
+
|
|
16
|
+
export default defineConfig(
|
|
17
|
+
// Base config for JavaScript files
|
|
18
|
+
{
|
|
19
|
+
languageOptions: {
|
|
20
|
+
globals: {
|
|
21
|
+
...globals.browser,
|
|
22
|
+
...globals.jquery,
|
|
23
|
+
...globals.jasmine
|
|
24
|
+
},
|
|
25
|
+
parser: tseslint.parser,
|
|
26
|
+
ecmaVersion: 2022,
|
|
27
|
+
sourceType: 'module'
|
|
28
|
+
},
|
|
29
|
+
extends: [eslint.configs.recommended, common]
|
|
30
|
+
},
|
|
31
|
+
// Additional config for TypeScript files (extends the base config from above)
|
|
32
|
+
{
|
|
33
|
+
extends: [tseslint.configs.recommended],
|
|
34
|
+
plugins: {
|
|
35
|
+
'@typescript-eslint': tseslint.plugin
|
|
36
|
+
},
|
|
37
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
38
|
+
rules: {
|
|
39
|
+
'spaced-comment': ['error', 'always', {'exceptions': ['*'], 'markers': ['/']}], // Allow triple slash directives
|
|
40
|
+
'prefer-const': 'off', // Enabled by TS ESLint, but we do not want to enforce it for now
|
|
41
|
+
'@typescript-eslint/no-empty-object-type': 'off',
|
|
42
|
+
'@typescript-eslint/no-inferrable-types': 'warn', // Changed from error to warn
|
|
43
|
+
'@typescript-eslint/ban-ts-comment': 'off', // Allow ts-ignore
|
|
44
|
+
'@typescript-eslint/no-unused-vars': 'off', // Allow unused parameters
|
|
45
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
46
|
+
'@typescript-eslint/no-this-alias': 'off', // Allow assigment of this to a variable, e.g. for better readability. 'That' and 'self' are not used often anymore.
|
|
47
|
+
'@typescript-eslint/prefer-ts-expect-error': 'warn',
|
|
48
|
+
'@typescript-eslint/no-unused-expressions': 'off', // Disabled to make log pattern work that is commonly used in scout ($.log.isTraceEnabled() && $.log.trace(msg));
|
|
49
|
+
'@stylistic/member-delimiter-style': 'warn', // Enforce semicolon for interface members for consistency
|
|
50
|
+
'@stylistic/object-curly-spacing': ['warn', 'never', {'overrides': {TSTypeLiteral: 'always', TSMappedType: 'always'}}]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
);
|
package/src/common.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2010, 2024 BSI Business Systems Integration AG
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made
|
|
5
|
-
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
-
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
-
*
|
|
8
|
-
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
-
*/
|
|
10
|
-
module.exports = {
|
|
11
|
-
rules: {
|
|
12
|
-
'indent': ['warn', 2, {'SwitchCase': 1}],
|
|
13
|
-
'no-extra-parens': ['off'],
|
|
14
|
-
'accessor-pairs': 'warn',
|
|
15
|
-
'array-callback-return': 'error',
|
|
16
|
-
'guard-for-in': 'off',
|
|
17
|
-
'no-alert': 'warn',
|
|
18
|
-
'no-eval': 'error',
|
|
19
|
-
'no-extra-bind': 'error',
|
|
20
|
-
'no-extra-label': 'error',
|
|
21
|
-
'no-implicit-coercion': 'off',
|
|
22
|
-
'no-implied-eval': 'error',
|
|
23
|
-
'no-invalid-this': 'off',
|
|
24
|
-
'no-iterator': 'error',
|
|
25
|
-
'no-caller': 'warn',
|
|
26
|
-
'no-console': 'off',
|
|
27
|
-
'no-labels': 'error',
|
|
28
|
-
'no-undef': 'off',
|
|
29
|
-
'no-throw-literal': 'off',
|
|
30
|
-
'camelcase': ['error', {allow: ['^\\$', '_']}],
|
|
31
|
-
'no-lone-blocks': 'error',
|
|
32
|
-
'no-loop-func': 'error',
|
|
33
|
-
'no-multi-spaces': 'warn',
|
|
34
|
-
'no-proto': 'error',
|
|
35
|
-
'no-prototype-builtins': 'off',
|
|
36
|
-
'no-return-assign': 'error',
|
|
37
|
-
'eslint func-call-spacing': 'off',
|
|
38
|
-
'no-return-await': 'off',
|
|
39
|
-
'no-self-compare': 'error',
|
|
40
|
-
'no-label-var': 'error',
|
|
41
|
-
'no-shadow': 'off',
|
|
42
|
-
'no-var': 'warn',
|
|
43
|
-
'eol-last': ['warn', 'always'],
|
|
44
|
-
'comma-spacing': ['error', {'before': false, 'after': true}],
|
|
45
|
-
'array-bracket-spacing': ['warn', 'never'],
|
|
46
|
-
'brace-style': ['error', '1tbs'],
|
|
47
|
-
'require-unicode-regexp': 'off',
|
|
48
|
-
'no-sequences': 'error',
|
|
49
|
-
'no-unmodified-loop-condition': 'error',
|
|
50
|
-
'computed-property-spacing': ['warn', 'never'],
|
|
51
|
-
'no-useless-return': 'error',
|
|
52
|
-
'no-else-return': 'error',
|
|
53
|
-
'max-len': ['warn', 240, 2, {ignoreUrls: true, ignorePattern: '^import .*'}],
|
|
54
|
-
'semi': ['error', 'always'],
|
|
55
|
-
'quotes': ['warn', 'single'],
|
|
56
|
-
'comma-dangle': ['error', 'never'],
|
|
57
|
-
'object-curly-spacing': ['error', 'never'],
|
|
58
|
-
'operator-linebreak': 'off',
|
|
59
|
-
'arrow-parens': ['error', 'as-needed'],
|
|
60
|
-
'arrow-spacing': 'warn',
|
|
61
|
-
'no-duplicate-imports': 'error',
|
|
62
|
-
'one-var': 'off',
|
|
63
|
-
'padded-blocks': 'off',
|
|
64
|
-
'prefer-arrow-callback': 'warn',
|
|
65
|
-
'prefer-template': 'off',
|
|
66
|
-
'template-curly-spacing': ['error', 'never'],
|
|
67
|
-
'linebreak-style': ['error', 'unix'],
|
|
68
|
-
'newline-per-chained-call': 'off',
|
|
69
|
-
'no-lonely-if': 'off',
|
|
70
|
-
'new-cap': ['error', {'capIsNewExceptions': ['Deferred', '$.Event'], 'capIsNewExceptionPattern': 'Model$'}],
|
|
71
|
-
'no-multi-assign': 'error',
|
|
72
|
-
'no-unused-vars': 'off',
|
|
73
|
-
'require-jsdoc': 'off',
|
|
74
|
-
'no-plusplus': 'off',
|
|
75
|
-
'no-trailing-spaces': 'warn',
|
|
76
|
-
'space-before-function-paren': ['warn', {
|
|
77
|
-
'anonymous': 'never',
|
|
78
|
-
'named': 'never',
|
|
79
|
-
'asyncArrow': 'always'
|
|
80
|
-
}],
|
|
81
|
-
'curly': ['error', 'all'],
|
|
82
|
-
'eqeqeq': ['error', 'always', {'null': 'ignore'}],
|
|
83
|
-
'spaced-comment': ['warn', 'always', {'exceptions': ['*']}],
|
|
84
|
-
'valid-jsdoc': 'off',
|
|
85
|
-
'prefer-const': 'off',
|
|
86
|
-
'prefer-rest-params': 'warn',
|
|
87
|
-
'prefer-spread': 'warn',
|
|
88
|
-
'max-classes-per-file': 'off'
|
|
89
|
-
}
|
|
90
|
-
};
|
package/src/index.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2010, 2023 BSI Business Systems Integration AG
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made
|
|
5
|
-
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
-
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
-
*
|
|
8
|
-
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
module.exports = {
|
|
13
|
-
env: {
|
|
14
|
-
es6: true,
|
|
15
|
-
browser: true,
|
|
16
|
-
jquery: true,
|
|
17
|
-
jasmine: true
|
|
18
|
-
},
|
|
19
|
-
extends: ['eslint:recommended', './common'],
|
|
20
|
-
// Use typescript parser for js files as well so babel parser is not necessary
|
|
21
|
-
parser: '@typescript-eslint/parser',
|
|
22
|
-
parserOptions: {
|
|
23
|
-
ecmaVersion: 6,
|
|
24
|
-
sourceType: 'module'
|
|
25
|
-
},
|
|
26
|
-
overrides: [{
|
|
27
|
-
extends: ['plugin:@typescript-eslint/recommended', './common'],
|
|
28
|
-
plugins: ['@typescript-eslint'],
|
|
29
|
-
files: ['*.ts', '*.tsx'],
|
|
30
|
-
rules: {
|
|
31
|
-
'@typescript-eslint/ban-types': 'warn', // Change from error to warn
|
|
32
|
-
'@typescript-eslint/no-inferrable-types': 'warn', // Change from error to warn
|
|
33
|
-
'@typescript-eslint/ban-ts-comment': 'off', // Allow ts-ignore
|
|
34
|
-
'@typescript-eslint/no-unused-vars': 'off', // Allow unused parameters
|
|
35
|
-
'spaced-comment': ['error', 'always', {'exceptions': ['*'], 'markers': ['/']}], // Allow triple slash directives
|
|
36
|
-
'semi': 'off', // Disable because it will be replaced by typescript rule below to avoid conflicting rules with semicolon in interfaces
|
|
37
|
-
'@typescript-eslint/semi': ['error'],
|
|
38
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
39
|
-
'@typescript-eslint/member-delimiter-style': 'warn', // Enforce semicolon for interface members for consistency,
|
|
40
|
-
'@typescript-eslint/no-this-alias': 'off', // Allow assigment of this to a variable, e.g. for better readability. 'That' and 'self' are not used often anymore.
|
|
41
|
-
'indent': 'off', // Disable because it will be replaced by the following ts rule
|
|
42
|
-
'@typescript-eslint/indent': ['warn', 2, {'SwitchCase': 1, 'ignoredNodes': ['PropertyDefinition[decorators]']}], // Workarounds bug https://github.com/typescript-eslint/typescript-eslint/issues/1824. See also https://github.com/eslint/eslint/issues/15299#issuecomment-967762181. Also change to warn because indent errors are not critical.
|
|
43
|
-
'linebreak-style': 'off',
|
|
44
|
-
'@typescript-eslint/prefer-ts-expect-error': 'warn',
|
|
45
|
-
'@typescript-eslint/no-empty-function': 'off'
|
|
46
|
-
}
|
|
47
|
-
}]
|
|
48
|
-
};
|