@eclipse-glsp/eslint-config 0.9.0-next.18041f6a → 0.9.0-next.34c10fc7

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 CHANGED
@@ -15,30 +15,11 @@ $ yarn add --dev @eclipse-glsp/eslint-config
15
15
  ```javascript
16
16
  /** @type {import('eslint').Linter.Config} */
17
17
  module.exports = {
18
- extends: "@eclipse-glsp",
18
+ extends: '@eclipse-glsp',
19
19
  parserOptions: {
20
20
  tsconfigRootDir: __dirname,
21
- project: "tsconfig.json",
22
- },
23
- };
24
- ```
25
-
26
- ## Usage without prettier
27
-
28
- The default shared ESLint configuration is expected to be used in combination with [Prettier](https://prettier.io/).
29
- As a consequence all stylistic rules that might conflict with Prettier haven been disabled.
30
- We provide an additional `no-prettier` configuration that can be used for projects that don't use Prettier.
31
-
32
- **Create a `.eslintrc.js`**:
33
-
34
- ```javascript
35
- /** @type {import('eslint').Linter.Config} */
36
- module.exports = {
37
- extends: "@eclipse-glsp/eslint-config/no-prettier",
38
- parserOptions: {
39
- tsconfigRootDir: __dirname,
40
- project: "tsconfig.json",
41
- },
21
+ project: 'tsconfig.json'
22
+ }
42
23
  };
43
24
  ```
44
25
 
@@ -5,14 +5,11 @@ module.exports = {
5
5
  // Possible Errors
6
6
  'no-inner-declarations': 'off',
7
7
  // Best Practices
8
- curly: 'error',
9
- 'eol-last': 'error',
10
8
  eqeqeq: ['error', 'smart'],
11
9
  'guard-for-in': 'error',
12
10
  'no-caller': 'error',
13
11
  'no-eval': 'error',
14
- 'no-redeclare': 'off',
15
- 'no-restricted-imports': ['error', '..', '../index', '../..', '../../index'],
12
+ 'no-restricted-imports': ['error', '..', '../index', '../..', '../../index', 'src'],
16
13
  'no-sequences': 'error',
17
14
  'no-throw-literal': 'error',
18
15
  'no-unused-expressions': [
@@ -25,13 +22,6 @@ module.exports = {
25
22
  // Variables
26
23
  'no-unused-vars': 'off', // typescript-eslint rule activated instead
27
24
  'no-use-before-define': 'off', // typescript-eslint rule activated instead
28
- // Stylistic Issues
29
- 'max-len': [
30
- 'error',
31
- {
32
- code: 180
33
- }
34
- ],
35
25
  'no-multiple-empty-lines': [
36
26
  'error',
37
27
  {
@@ -40,18 +30,9 @@ module.exports = {
40
30
  ],
41
31
  'no-underscore-dangle': 'off',
42
32
  quotes: 'off', // typescript-eslint rule activated instead
43
- 'space-before-function-paren': [
44
- 'error',
45
- {
46
- anonymous: 'always',
47
- named: 'never',
48
- asyncArrow: 'always'
49
- }
50
- ],
51
33
  'one-var': ['error', 'never'],
52
34
  // ECMAScript6
53
35
  'arrow-body-style': ['error', 'as-needed'],
54
- 'arrow-parens': ['error', 'as-needed'],
55
36
  'no-var': 'error',
56
37
  'prefer-const': [
57
38
  'error',
@@ -62,7 +43,6 @@ module.exports = {
62
43
  // @typescript-eslint/eslint-plugin
63
44
  '@typescript-eslint/naming-convention': 'off',
64
45
  '@typescript-eslint/consistent-type-definitions': 'error',
65
- '@typescript-eslint/no-explicit-any': 'off',
66
46
  '@typescript-eslint/no-misused-new': 'error',
67
47
  '@typescript-eslint/no-empty-interface': 'off',
68
48
  '@typescript-eslint/no-namespace': 'off',
@@ -73,14 +53,6 @@ module.exports = {
73
53
  args: 'none'
74
54
  }
75
55
  ],
76
- '@typescript-eslint/quotes': [
77
- 'error',
78
- 'single',
79
- {
80
- avoidEscape: true
81
- }
82
- ],
83
- '@typescript-eslint/semi': ['error', 'always'],
84
56
  // eslint-plugin-header
85
57
  'header/header': [
86
58
  2,
@@ -3,6 +3,8 @@ module.exports = {
3
3
  // https://eslint.org/docs/rules/
4
4
  'brace-style': ['warn', '1tbs'],
5
5
  'comma-dangle': 'warn',
6
+ curly: 'warn',
7
+ 'eol-last': 'warn',
6
8
  indent: [
7
9
  'warn',
8
10
  4,
@@ -13,6 +15,7 @@ module.exports = {
13
15
  'no-invalid-this': 'warn',
14
16
  'no-new-wrappers': 'warn',
15
17
  'no-return-await': 'warn',
18
+ 'no-redeclare': 'off',
16
19
  'no-shadow': [
17
20
  'warn',
18
21
  {
@@ -36,8 +39,33 @@ module.exports = {
36
39
  exceptions: ['*', '+', '-', '/', '!']
37
40
  }
38
41
  ],
42
+ 'space-before-function-paren': [
43
+ 'warn',
44
+ {
45
+ anonymous: 'always',
46
+ named: 'never',
47
+ asyncArrow: 'always'
48
+ }
49
+ ],
50
+ // Stylistic Issues
51
+ 'max-len': [
52
+ 'warn',
53
+ {
54
+ code: 140
55
+ }
56
+ ],
39
57
  'use-isnan': 'warn',
58
+ 'arrow-parens': ['warn', 'as-needed'],
59
+
40
60
  // @typescript-eslint/eslint-plugin
61
+ '@typescript-eslint/semi': ['warn', 'always'],
62
+ '@typescript-eslint/quotes': [
63
+ 'warn',
64
+ 'single',
65
+ {
66
+ avoidEscape: true
67
+ }
68
+ ],
41
69
  '@typescript-eslint/explicit-function-return-type': [
42
70
  'warn',
43
71
  {
package/index.js CHANGED
@@ -1,4 +1,9 @@
1
+ module.exports = require('./configs/base.eslintrc');
2
+ module.exports = require('./configs/errors.eslintrc');
3
+ module.exports = require('./configs/warnings.eslintrc');
4
+ /** @type {import('eslint').Linter.Config} */
1
5
  module.exports = {
2
- extends: ['./no-prettier', 'prettier'],
3
- root: 'true'
6
+ extends: ['prettier', './configs/base.eslintrc', './configs/warnings.eslintrc', './configs/errors.eslintrc'],
7
+ ignorePatterns: ['**/{css,node_modules,lib}'],
8
+ root: true
4
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-glsp/eslint-config",
3
- "version": "0.9.0-next.18041f6a",
3
+ "version": "0.9.0-next.34c10fc7",
4
4
  "description": "Shared ESLint configuration for GLSP projects",
5
5
  "license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
6
6
  "keywords": [
package/no-prettier.js DELETED
@@ -1,12 +0,0 @@
1
- module.exports = require("./configs/base.eslintrc");
2
- module.exports = require("./configs/errors.eslintrc");
3
- module.exports = require("./configs/warnings.eslintrc");
4
- /** @type {import('eslint').Linter.Config} */
5
- module.exports = {
6
- extends: [
7
- "./configs/base.eslintrc",
8
- "./configs/warnings.eslintrc",
9
- "./configs/errors.eslintrc",
10
- ],
11
- ignorePatterns: ["**/{css,node_modules,lib}"],
12
- };