@tpluscode/eslint-config 0.3.3 → 0.4.0

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.
@@ -9,6 +9,6 @@ jobs:
9
9
  - uses: actions/checkout@v2
10
10
  - uses: actions/setup-node@v2.1.2
11
11
  with:
12
- node-version: 13
12
+ node-version: 14
13
13
  - run: yarn
14
14
  - run: yarn test
@@ -19,7 +19,7 @@ jobs:
19
19
  - name: Setup Node.js
20
20
  uses: actions/setup-node@v2.1.2
21
21
  with:
22
- node-version: 13
22
+ node-version: 14
23
23
 
24
24
  - name: Install Dependencies
25
25
  run: yarn
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 92ac89c: Added `eslint-plugin-require-extensions`
8
+
9
+ ## 0.3.4
10
+
11
+ ### Patch Changes
12
+
13
+ - 191763b: Added a base config for JS-only projects
14
+
3
15
  ## 0.3.3
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -1,26 +1,43 @@
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 \
16
15
  eslint-plugin-promise \
17
16
  eslint-plugin-n \
17
+ eslint-plugin-require-extensions \
18
18
  standard
19
19
  ```
20
20
 
21
- ## Usage
21
+ If you write code in TypeScript, add:
22
+
23
+ ```
24
+ npm i --save-dev \
25
+ @typescript-eslint/eslint-plugin \
26
+ @typescript-eslint/parser \
27
+ eslint-import-resolver-typescript
28
+ ```
29
+
30
+ ## eslint config
31
+
32
+ In a JavaScript project:
33
+
34
+ ```json
35
+ {
36
+ "extends": [ "@tpluscode/eslint-config/js" ]
37
+ }
38
+ ```
22
39
 
23
- In your eslint config:
40
+ In a TypeScript project:
24
41
 
25
42
  ```json
26
43
  {
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,59 @@
1
+ module.exports = {
2
+ extends: [
3
+ 'standard',
4
+ 'plugin:import/errors',
5
+ 'plugin:import/warnings',
6
+ 'plugin:require-extensions/recommended'
7
+ ],
8
+ plugins: [
9
+ 'import',
10
+ 'require-extensions'
11
+ ],
12
+ rules: {
13
+ indent: ['error', 2],
14
+ 'no-console': 'error',
15
+ 'import/no-unresolved': 'error',
16
+ 'import/extensions': 'off',
17
+ 'import/order': 'error',
18
+ 'space-before-function-paren': [
19
+ 'error',
20
+ {
21
+ named: 'never'
22
+ }
23
+ ],
24
+ 'comma-dangle': [
25
+ 'error',
26
+ 'always-multiline'
27
+ ],
28
+ 'import/no-extraneous-dependencies': [
29
+ 'error',
30
+ {
31
+ devDependencies: [
32
+ '**/test/**/*.ts',
33
+ '*.test.ts',
34
+ '*.spec.ts',
35
+ '**/test/**/*.js',
36
+ '*.test.js',
37
+ '*.spec.js'
38
+ ],
39
+ optionalDependencies: false
40
+ }
41
+ ]
42
+ },
43
+ settings: {
44
+ 'import/core-modules': ['rdf-js']
45
+ },
46
+ overrides: [
47
+ {
48
+ files: [
49
+ '*.test.js',
50
+ '*.spec.js',
51
+ '*.test.ts',
52
+ '*.spec.ts'
53
+ ],
54
+ rules: {
55
+ 'no-unused-expressions': 'off'
56
+ }
57
+ }
58
+ ]
59
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tpluscode/eslint-config",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -10,17 +10,26 @@
10
10
  },
11
11
  "peerDependencies": {
12
12
  "eslint": ">=6",
13
- "eslint-import-resolver-typescript": ">=2",
13
+ "eslint-config-standard": ">=11",
14
+ "eslint-plugin-import": ">=2",
15
+ "eslint-plugin-node": ">=11",
16
+ "eslint-plugin-promise": ">=6",
17
+ "eslint-plugin-n": ">=15",
18
+ "eslint-plugin-require-extensions": ">=0.1.2",
19
+ "standard": ">=11"
20
+ },
21
+ "optionalDependencies": {
14
22
  "@typescript-eslint/eslint-plugin": ">=2",
15
23
  "@typescript-eslint/parser": ">=2",
16
- "standard": ">=11"
24
+ "eslint-import-resolver-typescript": ">=2"
17
25
  },
18
26
  "devDependencies": {
19
- "@changesets/cli": "^2.15.0",
27
+ "@changesets/cli": "^2.26.0",
20
28
  "eslint": "^7.23.0",
21
29
  "eslint-config-standard": "^16.0.2",
22
30
  "eslint-plugin-import": "^2.22.1",
23
31
  "eslint-plugin-node": "^11.1.0",
32
+ "eslint-plugin-promise": "^6.1.1",
24
33
  "standard": "^16.0.3",
25
34
  "lint-staged": "^10.5.4",
26
35
  "husky": "^6.0.0"