@dataport/eslint-config-geodev 0.1.0 → 0.2.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 CHANGED
@@ -1,2 +1,39 @@
1
- # eslint-config
2
- Global ESLint configurations for JavaScript projects
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 'eslint-config-geodev'
18
+ import nodeConfig from 'eslint-config-geodev/node'
19
+ import tsConfig from '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`
@@ -0,0 +1,11 @@
1
+ import globals from 'globals'
2
+
3
+ export default [
4
+ {
5
+ languageOptions: {
6
+ globals: {
7
+ ...globals.browser,
8
+ },
9
+ },
10
+ },
11
+ ]
package/configs/index.js CHANGED
@@ -1,12 +1,32 @@
1
- import stylistic from '@stylistic/eslint-plugin'
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
- '@stylistic/indent': [ 'error', 'tab' ],
9
+ 'comma-dangle': ['error', 'always-multiline'],
10
+ 'no-console': ['error', { allow: ['warn', 'error'] }],
11
+ 'no-debugger': 'error',
12
+ curly: 'error',
13
+ 'no-else-return': 'error',
14
+ 'no-lonely-if': 'error',
15
+ 'require-await': 'error',
16
+ 'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
17
+ 'no-eval': 'error',
18
+ 'no-implied-eval': 'error',
19
+ complexity: 'warn',
20
+ 'max-depth': 'warn',
21
+
22
+ '@stylistic/indent': ['error', 'tab'],
23
+ '@stylistic/no-tabs': 'off',
24
+ '@stylistic/no-multi-spaces': 'error',
25
+ '@stylistic/brace-style': 'error',
26
+ '@stylistic/no-extra-parens': 'error',
27
+ '@stylistic/eol-last': 'error',
28
+
29
+ 'import-x/order': 'error',
10
30
  },
11
31
  },
12
32
  ]
@@ -0,0 +1,11 @@
1
+ import globals from 'globals'
2
+
3
+ export default [
4
+ {
5
+ languageOptions: {
6
+ globals: {
7
+ ...globals.nodeBuiltin,
8
+ },
9
+ },
10
+ },
11
+ ]
@@ -0,0 +1,28 @@
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
+ 'no-use-before-define': 'off',
13
+ '@typescript-eslint/promise-function-async': 'off',
14
+ '@typescript-eslint/naming-convention': [
15
+ 'error',
16
+ {
17
+ selector: ['typeLike'],
18
+ format: ['PascalCase'],
19
+ },
20
+ {
21
+ selector: ['memberLike'],
22
+ format: ['camelCase', 'UPPER_CASE', 'snake_case'],
23
+ },
24
+ ],
25
+ '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
26
+ },
27
+ },
28
+ ]
package/configs/vue.js ADDED
@@ -0,0 +1,5 @@
1
+ import vue from 'eslint-plugin-vue'
2
+
3
+ export default [
4
+ ...vue.configs['flat/recommended'],
5
+ ]
@@ -0,0 +1,11 @@
1
+ import vue from 'eslint-plugin-vue'
2
+
3
+ export default [
4
+ ...vue.configs['flat/vue2-recommended'],
5
+ {
6
+ rules: {
7
+ 'vue/multi-word-component-names': 'warn',
8
+ 'vue/order-in-components': 'error',
9
+ },
10
+ },
11
+ ]
package/eslint.config.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import { defineConfig } from 'eslint/config'
2
- import geodevConfig from './configs/index.js'
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: [ '**/*.js' ],
7
- extends: [ geodevConfig ],
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.1.0",
3
+ "version": "0.2.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
- "@stylistic/eslint-plugin": "^4.2.0"
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"