@eclipse-glsp/eslint-config 0.9.0-next.890ff998 → 0.9.0-next.a9855b44

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
 
@@ -1,25 +1,24 @@
1
1
  module.exports = {
2
- parser: "@typescript-eslint/parser",
2
+ parser: '@typescript-eslint/parser',
3
3
  parserOptions: {
4
- sourceType: "module",
4
+ sourceType: 'module',
5
5
  ecmaVersion: 6,
6
6
  ecmaFeatures: {
7
- jsx: true,
8
- },
7
+ jsx: true
8
+ }
9
9
  },
10
- plugins: ["@typescript-eslint", "header", "import", "no-null"],
10
+ plugins: ['@typescript-eslint', 'header', 'import', 'no-null'],
11
11
  extends: [
12
- "eslint:recommended",
13
- "plugin:@typescript-eslint/eslint-recommended",
14
- "plugin:@typescript-eslint/recommended",
15
- "plugin:import/errors",
16
- "plugin:import/warnings",
17
- "plugin:import/typescript",
12
+ 'eslint:recommended',
13
+ 'plugin:@typescript-eslint/recommended',
14
+ 'plugin:import/errors',
15
+ 'plugin:import/warnings',
16
+ 'plugin:import/typescript'
18
17
  ],
19
18
  env: {
20
19
  browser: true,
21
20
  mocha: true,
22
- es6: true,
21
+ es6: true
23
22
  },
24
- ignorePatterns: ["node_modules", "*.d.ts"],
23
+ ignorePatterns: ['node_modules', '*.d.ts']
25
24
  };
@@ -5,19 +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': [
15
- 'error',
16
- {
17
- builtinGlobals: false
18
- }
19
- ],
20
- 'no-restricted-imports': ['error', '..', '../index', '../..', '../../index'],
12
+ 'no-restricted-imports': ['error', '..', '../index', '../..', '../../index', 'src'],
21
13
  'no-sequences': 'error',
22
14
  'no-throw-literal': 'error',
23
15
  'no-unused-expressions': [
@@ -30,33 +22,11 @@ module.exports = {
30
22
  // Variables
31
23
  'no-unused-vars': 'off', // typescript-eslint rule activated instead
32
24
  'no-use-before-define': 'off', // typescript-eslint rule activated instead
33
- // Stylistic Issues
34
- 'max-len': [
35
- 'error',
36
- {
37
- code: 180
38
- }
39
- ],
40
- 'no-multiple-empty-lines': [
41
- 'error',
42
- {
43
- max: 1
44
- }
45
- ],
46
25
  'no-underscore-dangle': 'off',
47
26
  quotes: 'off', // typescript-eslint rule activated instead
48
- 'space-before-function-paren': [
49
- 'error',
50
- {
51
- anonymous: 'always',
52
- named: 'never',
53
- asyncArrow: 'always'
54
- }
55
- ],
56
27
  'one-var': ['error', 'never'],
57
28
  // ECMAScript6
58
29
  'arrow-body-style': ['error', 'as-needed'],
59
- 'arrow-parens': ['error', 'as-needed'],
60
30
  'no-var': 'error',
61
31
  'prefer-const': [
62
32
  'error',
@@ -65,12 +35,10 @@ module.exports = {
65
35
  }
66
36
  ],
67
37
  // @typescript-eslint/eslint-plugin
68
- '@typescript-eslint/class-name-casing': 'error',
38
+ '@typescript-eslint/naming-convention': 'off',
69
39
  '@typescript-eslint/consistent-type-definitions': 'error',
70
- '@typescript-eslint/no-explicit-any': 'off',
71
40
  '@typescript-eslint/no-misused-new': 'error',
72
41
  '@typescript-eslint/no-empty-interface': 'off',
73
- '@typescript-eslint/interface-name-prefix': 'off',
74
42
  '@typescript-eslint/no-namespace': 'off',
75
43
  '@typescript-eslint/no-use-before-define': 'off',
76
44
  '@typescript-eslint/no-unused-vars': [
@@ -79,14 +47,6 @@ module.exports = {
79
47
  args: 'none'
80
48
  }
81
49
  ],
82
- '@typescript-eslint/quotes': [
83
- 'error',
84
- 'single',
85
- {
86
- avoidEscape: true
87
- }
88
- ],
89
- '@typescript-eslint/semi': ['error', 'always'],
90
50
  // eslint-plugin-header
91
51
  'header/header': [
92
52
  2,
@@ -1,50 +1,79 @@
1
1
  module.exports = {
2
2
  rules: {
3
3
  // https://eslint.org/docs/rules/
4
- "brace-style": ["warn", "1tbs"],
5
- "comma-dangle": "warn",
6
- indent: [
7
- "warn",
8
- 4,
9
- {
10
- SwitchCase: 1,
11
- },
12
- ],
13
- "no-invalid-this": "warn",
14
- "no-new-wrappers": "warn",
15
- "no-return-await": "warn",
16
- "no-shadow": [
17
- "warn",
18
- {
19
- hoist: "all",
20
- },
21
- ],
22
- "no-trailing-spaces": "warn",
23
- "no-void": "warn",
24
- "prefer-const": [
25
- "warn",
26
- {
27
- destructuring: "all",
28
- },
29
- ],
30
- "prefer-object-spread": "warn",
31
- radix: "warn",
32
- "spaced-comment": [
33
- "warn",
34
- "always",
35
- {
36
- exceptions: ["*", "+", "-", "/", "!"],
37
- },
38
- ],
39
- "use-isnan": "warn",
4
+ 'brace-style': ['warn', '1tbs'],
5
+ 'comma-dangle': 'warn',
6
+ curly: 'warn',
7
+ 'eol-last': 'warn',
8
+ 'no-invalid-this': 'warn',
9
+ 'no-new-wrappers': 'warn',
10
+ 'no-return-await': 'warn',
11
+ 'no-redeclare': 'off',
12
+ 'no-shadow': [
13
+ 'warn',
14
+ {
15
+ hoist: 'all'
16
+ }
17
+ ],
18
+ 'no-multiple-empty-lines': [
19
+ 'warn',
20
+ {
21
+ max: 1
22
+ }
23
+ ],
24
+ 'no-trailing-spaces': 'warn',
25
+ 'no-void': 'warn',
26
+ 'prefer-const': [
27
+ 'warn',
28
+ {
29
+ destructuring: 'all'
30
+ }
31
+ ],
32
+ 'prefer-object-spread': 'warn',
33
+ radix: 'warn',
34
+ 'spaced-comment': [
35
+ 'warn',
36
+ 'always',
37
+ {
38
+ exceptions: ['*', '+', '-', '/', '!']
39
+ }
40
+ ],
41
+ 'space-before-function-paren': [
42
+ 'warn',
43
+ {
44
+ anonymous: 'always',
45
+ named: 'never',
46
+ asyncArrow: 'always'
47
+ }
48
+ ],
49
+ // Stylistic Issues
50
+ 'max-len': [
51
+ 'warn',
52
+ {
53
+ code: 140
54
+ }
55
+ ],
56
+ 'use-isnan': 'warn',
57
+ 'arrow-parens': ['warn', 'as-needed'],
58
+
40
59
  // @typescript-eslint/eslint-plugin
41
- "@typescript-eslint/explicit-function-return-type": [
42
- "warn",
60
+ '@typescript-eslint/semi': ['warn', 'always'],
61
+ '@typescript-eslint/quotes': [
62
+ 'warn',
63
+ 'single',
64
+ {
65
+ avoidEscape: true
66
+ }
67
+ ],
68
+ '@typescript-eslint/explicit-function-return-type': [
69
+ 'warn',
43
70
  {
44
- allowExpressions: true,
45
- },
71
+ allowExpressions: true
72
+ }
46
73
  ],
47
- "@typescript-eslint/no-non-null-assertion": "off",
48
- "@typescript-eslint/type-annotation-spacing": "warn",
49
- },
74
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
75
+ '@typescript-eslint/no-non-null-assertion': 'off',
76
+ '@typescript-eslint/type-annotation-spacing': 'warn',
77
+ '@typescript-eslint/no-explicit-any': 'off'
78
+ }
50
79
  };
package/index.js CHANGED
@@ -1,3 +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"],
6
+ extends: ['prettier', './configs/base.eslintrc', './configs/warnings.eslintrc', './configs/errors.eslintrc'],
7
+ ignorePatterns: ['**/{css,node_modules,lib}'],
8
+ root: true
3
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-glsp/eslint-config",
3
- "version": "0.9.0-next.890ff998",
3
+ "version": "0.9.0-next.a9855b44",
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
- };