@tpluscode/eslint-config 0.3.3 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 191763b: Added a base config for JS-only projects
8
+
3
9
  ## 0.3.3
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -1,15 +1,14 @@
1
1
  # @tpluscode/eslint-config
2
2
 
3
- Slightly customized `standard` config with TypeScript rules enabled.
3
+ Slightly customized `standard` config.
4
4
 
5
5
  ## Installation
6
6
 
7
+ For JS project:
8
+
7
9
  ```
8
10
  npm i --save-dev \
9
11
  @tpluscode/eslint-config \
10
- @typescript-eslint/eslint-plugin \
11
- @typescript-eslint/parser \
12
- eslint-import-resolver-typescript \
13
12
  eslint-config-standard \
14
13
  eslint-plugin-import \
15
14
  eslint-plugin-node \
@@ -18,9 +17,26 @@ npm i --save-dev \
18
17
  standard
19
18
  ```
20
19
 
21
- ## Usage
20
+ If you write code in TypeScript, add:
21
+
22
+ ```
23
+ npm i --save-dev \
24
+ @typescript-eslint/eslint-plugin \
25
+ @typescript-eslint/parser \
26
+ eslint-import-resolver-typescript
27
+ ```
28
+
29
+ ## eslint config
30
+
31
+ In a JavaScript project:
32
+
33
+ ```json
34
+ {
35
+ "extends": [ "@tpluscode/eslint-config/js" ]
36
+ }
37
+ ```
22
38
 
23
- In your eslint config:
39
+ In a TypeScript project:
24
40
 
25
41
  ```json
26
42
  {
package/index.js CHANGED
@@ -1,34 +1,17 @@
1
1
  module.exports = {
2
2
  extends: [
3
3
  'plugin:@typescript-eslint/recommended',
4
- 'standard',
5
- 'plugin:import/errors',
6
- 'plugin:import/warnings',
4
+ './js.js',
7
5
  'plugin:import/typescript'
8
6
  ],
9
7
  parserOptions: {
10
8
  parser: '@typescript-eslint/parser'
11
9
  },
12
10
  plugins: [
13
- '@typescript-eslint/eslint-plugin',
14
- 'import'
11
+ '@typescript-eslint/eslint-plugin'
15
12
  ],
16
13
  rules: {
17
14
  indent: 'off',
18
- 'no-console': 'error',
19
- 'import/no-unresolved': 'error',
20
- 'import/extensions': 'off',
21
- 'import/order': 'error',
22
- 'space-before-function-paren': [
23
- 'error',
24
- {
25
- named: 'never'
26
- }
27
- ],
28
- 'comma-dangle': [
29
- 'error',
30
- 'always-multiline'
31
- ],
32
15
  '@typescript-eslint/indent': ['error', 2],
33
16
  '@typescript-eslint/member-delimiter-style': [
34
17
  'error',
@@ -38,27 +21,12 @@ module.exports = {
38
21
  }
39
22
  }
40
23
  ],
41
- 'import/no-extraneous-dependencies': [
42
- 'error',
43
- {
44
- devDependencies: [
45
- '**/test/**/*.ts',
46
- '*.test.ts',
47
- '*.spec.ts',
48
- '**/test/**/*.js',
49
- '*.test.js',
50
- '*.spec.js'
51
- ],
52
- optionalDependencies: false
53
- }
54
- ],
55
24
  'no-dupe-class-members': 'off',
56
25
  '@typescript-eslint/no-dupe-class-members': ['error'],
57
26
  'no-redeclare': 'off',
58
27
  '@typescript-eslint/no-redeclare': 'warn'
59
28
  },
60
29
  settings: {
61
- 'import/core-modules': ['rdf-js'],
62
30
  'import/parsers': {
63
31
  '@typescript-eslint/parser': ['.ts', '.tsx']
64
32
  },
@@ -78,17 +46,6 @@ module.exports = {
78
46
  '@typescript-eslint/no-var-requires': 'off'
79
47
  }
80
48
  },
81
- {
82
- files: [
83
- '*.test.js',
84
- '*.spec.js',
85
- '*.test.ts',
86
- '*.spec.ts'
87
- ],
88
- rules: {
89
- 'no-unused-expressions': 'off'
90
- }
91
- },
92
49
  {
93
50
  files: '*.ts',
94
51
  rules: {
package/js.js ADDED
@@ -0,0 +1,57 @@
1
+ module.exports = {
2
+ extends: [
3
+ 'standard',
4
+ 'plugin:import/errors',
5
+ 'plugin:import/warnings'
6
+ ],
7
+ plugins: [
8
+ 'import'
9
+ ],
10
+ rules: {
11
+ indent: ['error', 2],
12
+ 'no-console': 'error',
13
+ 'import/no-unresolved': 'error',
14
+ 'import/extensions': 'off',
15
+ 'import/order': 'error',
16
+ 'space-before-function-paren': [
17
+ 'error',
18
+ {
19
+ named: 'never'
20
+ }
21
+ ],
22
+ 'comma-dangle': [
23
+ 'error',
24
+ 'always-multiline'
25
+ ],
26
+ 'import/no-extraneous-dependencies': [
27
+ 'error',
28
+ {
29
+ devDependencies: [
30
+ '**/test/**/*.ts',
31
+ '*.test.ts',
32
+ '*.spec.ts',
33
+ '**/test/**/*.js',
34
+ '*.test.js',
35
+ '*.spec.js'
36
+ ],
37
+ optionalDependencies: false
38
+ }
39
+ ]
40
+ },
41
+ settings: {
42
+ 'import/core-modules': ['rdf-js']
43
+ },
44
+ overrides: [
45
+ {
46
+ files: [
47
+ '*.test.js',
48
+ '*.spec.js',
49
+ '*.test.ts',
50
+ '*.spec.ts'
51
+ ],
52
+ rules: {
53
+ 'no-unused-expressions': 'off'
54
+ }
55
+ }
56
+ ]
57
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tpluscode/eslint-config",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {