@dataport/eslint-config-geodev 0.1.0 → 0.3.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.
- package/README.md +39 -2
- package/configs/browser.js +11 -0
- package/configs/index.js +16 -5
- package/configs/node.js +11 -0
- package/configs/typescript.js +26 -0
- package/configs/vue.js +5 -0
- package/configs/vue2.js +11 -0
- package/eslint.config.js +4 -3
- package/package.json +15 -2
package/README.md
CHANGED
|
@@ -1,2 +1,39 @@
|
|
|
1
|
-
# eslint-config
|
|
2
|
-
|
|
1
|
+
# @dataport/eslint-config-geodev
|
|
2
|
+
|
|
3
|
+
This package provides shared ESLint configurations for JavaScript projects.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
$ npm i -D eslint @dataport/eslint-config-geodev
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Example for eslint.config.js:
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import { defineConfig } from 'eslint/config'
|
|
17
|
+
import mainConfig from '@dataport/eslint-config-geodev'
|
|
18
|
+
import nodeConfig from '@dataport/eslint-config-geodev/node'
|
|
19
|
+
import tsConfig from '@dataport/eslint-config-geodev/typescript'
|
|
20
|
+
|
|
21
|
+
export default defineConfig([
|
|
22
|
+
{
|
|
23
|
+
files: ['**/*.js', '**/*.ts'],
|
|
24
|
+
extends: [mainConfig, nodeConfig],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
files: ['**/*.ts'],
|
|
28
|
+
extends: [tsConfig],
|
|
29
|
+
},
|
|
30
|
+
])
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The following sub-configs are offered:
|
|
34
|
+
|
|
35
|
+
- `node`
|
|
36
|
+
- `browser`
|
|
37
|
+
- `typescript`
|
|
38
|
+
- `vue`
|
|
39
|
+
- `vue2`
|
package/configs/index.js
CHANGED
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import js from '@eslint/js'
|
|
2
|
+
import neostandard from 'neostandard'
|
|
2
3
|
|
|
3
4
|
export default [
|
|
5
|
+
js.configs.recommended,
|
|
6
|
+
...neostandard(),
|
|
4
7
|
{
|
|
5
|
-
plugins: {
|
|
6
|
-
'@stylistic': stylistic,
|
|
7
|
-
},
|
|
8
8
|
rules: {
|
|
9
|
-
'
|
|
9
|
+
'no-console': ['error', { allow: ['warn', 'error'] }],
|
|
10
|
+
curly: 'error',
|
|
11
|
+
'no-else-return': 'error',
|
|
12
|
+
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
|
|
13
|
+
complexity: 'warn',
|
|
14
|
+
'max-depth': 'warn',
|
|
15
|
+
|
|
16
|
+
'@stylistic/comma-dangle': ['error', 'always-multiline'],
|
|
17
|
+
'@stylistic/indent': ['error', 'tab'],
|
|
18
|
+
'@stylistic/no-tabs': 'off',
|
|
19
|
+
|
|
20
|
+
'import-x/order': 'error',
|
|
10
21
|
},
|
|
11
22
|
},
|
|
12
23
|
]
|
package/configs/node.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import tseslint from 'typescript-eslint'
|
|
2
|
+
import tsdoc from 'eslint-plugin-tsdoc'
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
...tseslint.configs.strict,
|
|
6
|
+
{
|
|
7
|
+
plugins: {
|
|
8
|
+
tsdoc,
|
|
9
|
+
},
|
|
10
|
+
rules: {
|
|
11
|
+
'tsdoc/syntax': 'warn',
|
|
12
|
+
'@typescript-eslint/naming-convention': [
|
|
13
|
+
'error',
|
|
14
|
+
{
|
|
15
|
+
selector: ['typeLike'],
|
|
16
|
+
format: ['PascalCase'],
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
selector: ['memberLike'],
|
|
20
|
+
format: ['camelCase', 'UPPER_CASE', 'snake_case'],
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
]
|
package/configs/vue.js
ADDED
package/configs/vue2.js
ADDED
package/eslint.config.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { defineConfig } from 'eslint/config'
|
|
2
|
-
import
|
|
2
|
+
import mainConfig from './configs/index.js'
|
|
3
|
+
import nodeConfig from './configs/node.js'
|
|
3
4
|
|
|
4
5
|
export default defineConfig([
|
|
5
6
|
{
|
|
6
|
-
files: [
|
|
7
|
-
extends: [
|
|
7
|
+
files: ['**/*.js'],
|
|
8
|
+
extends: [mainConfig, nodeConfig],
|
|
8
9
|
},
|
|
9
10
|
])
|
package/package.json
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataport/eslint-config-geodev",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Generic ESLint configuration for geo development projects at Dataport",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "configs/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./configs/index.js",
|
|
9
|
+
"./node": "./configs/node.js",
|
|
10
|
+
"./browser": "./configs/browser.js",
|
|
11
|
+
"./typescript": "./configs/typescript.js",
|
|
12
|
+
"./vue": "./configs/vue.js",
|
|
13
|
+
"./vue2": "./configs/vue2.js"
|
|
14
|
+
},
|
|
7
15
|
"scripts": {
|
|
8
16
|
"lint": "eslint .",
|
|
9
17
|
"lint:fix": "eslint --fix ."
|
|
@@ -19,7 +27,12 @@
|
|
|
19
27
|
},
|
|
20
28
|
"homepage": "https://github.com/Dataport/eslint-config-geodev#readme",
|
|
21
29
|
"dependencies": {
|
|
22
|
-
"@
|
|
30
|
+
"@eslint/js": "^9.25.1",
|
|
31
|
+
"eslint-plugin-tsdoc": "^0.4.0",
|
|
32
|
+
"eslint-plugin-vue": "^10.0.0",
|
|
33
|
+
"globals": "^16.0.0",
|
|
34
|
+
"neostandard": "^0.12.1",
|
|
35
|
+
"typescript-eslint": "^8.31.0"
|
|
23
36
|
},
|
|
24
37
|
"devDependencies": {
|
|
25
38
|
"eslint": "^9.25.1"
|