@neovici/cfg 1.56.0 → 2.0.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.
@@ -0,0 +1,137 @@
1
+ import globals from 'globals';
2
+ import html from 'eslint-plugin-html';
3
+ import importPlugin from 'eslint-plugin-import';
4
+ import eslint from '@eslint/js';
5
+ import eslintConfigPrettier from 'eslint-config-prettier';
6
+ import testConfig from './test.mjs';
7
+ import tsConfig from './typescript.mjs';
8
+
9
+ export default [
10
+ eslint.configs.recommended,
11
+ importPlugin.flatConfigs.recommended,
12
+ importPlugin.flatConfigs.typescript,
13
+ eslintConfigPrettier,
14
+ {
15
+ languageOptions: {
16
+ ecmaVersion: 'latest',
17
+ sourceType: 'module',
18
+ globals: {
19
+ ...globals.browser,
20
+ ...globals.es6,
21
+ },
22
+ },
23
+ plugins: { html },
24
+ rules: {
25
+ 'accessor-pairs': 'error',
26
+ 'array-callback-return': 'warn',
27
+ 'block-scoped-var': 'error',
28
+ camelcase: 'error',
29
+ complexity: ['warn', 20],
30
+ 'consistent-this': ['error', 'that'],
31
+ 'constructor-super': 'error',
32
+ curly: ['error', 'multi-line'],
33
+ eqeqeq: ['error', 'smart'],
34
+ 'func-name-matching': ['error', 'always'],
35
+ 'func-names': ['error', 'never'],
36
+ 'func-style': ['error', 'expression'],
37
+ 'guard-for-in': 'error',
38
+ 'import/no-extraneous-dependencies': 'warn',
39
+ 'max-depth': ['error', 4],
40
+ 'max-len': [
41
+ 'warn',
42
+ {
43
+ code: 160,
44
+ tabWidth: 2,
45
+ },
46
+ ],
47
+ 'max-lines': [
48
+ 'warn',
49
+ {
50
+ max: 350,
51
+ skipBlankLines: true,
52
+ skipComments: true,
53
+ },
54
+ ],
55
+ 'max-nested-callbacks': ['error', 5],
56
+ 'max-params': ['error', 5],
57
+ 'max-statements': ['warn', 15],
58
+ 'max-statements-per-line': [
59
+ 'error',
60
+ {
61
+ max: 1,
62
+ },
63
+ ],
64
+ 'new-cap': [
65
+ 'error',
66
+ {
67
+ capIsNew: true,
68
+ newIsCap: true,
69
+ },
70
+ ],
71
+ 'no-alert': 'error',
72
+ 'no-console': 'error',
73
+ 'no-debugger': 'error',
74
+ 'no-bitwise': 'error',
75
+ 'no-const-assign': 'error',
76
+ 'no-dupe-class-members': 'error',
77
+ 'no-duplicate-imports': 'error',
78
+ 'no-else-return': 'error',
79
+ 'no-empty': 'error',
80
+ 'no-empty-function': 'error',
81
+ 'no-eval': 'error',
82
+ 'no-extra-bind': 'error',
83
+ 'no-global-assign': 'error',
84
+ 'no-implicit-globals': 'error',
85
+ 'no-invalid-this': 'error',
86
+ 'no-labels': 'error',
87
+ 'no-lone-blocks': 'error',
88
+ 'no-lonely-if': 'error',
89
+ 'no-loop-func': 'error',
90
+ 'no-new': 'error',
91
+ 'no-new-func': 'error',
92
+ 'no-nested-ternary': 'error',
93
+ 'no-param-reassign': 'error',
94
+ 'no-redeclare': 'error',
95
+ 'no-return-assign': 'error',
96
+ 'no-self-compare': 'error',
97
+ 'no-sequences': 'error',
98
+ 'no-template-curly-in-string': 'error',
99
+ 'no-this-before-super': 'error',
100
+ 'no-throw-literal': 'error',
101
+ 'no-undef-init': 'error',
102
+ 'no-unmodified-loop-condition': 'error',
103
+ 'no-unneeded-ternary': 'error',
104
+ 'no-unused-expressions': 'error',
105
+ 'no-unused-vars': 'error',
106
+ 'no-use-before-define': 'error',
107
+ 'no-useless-call': 'error',
108
+ 'no-useless-computed-key': 'error',
109
+ 'no-useless-concat': 'error',
110
+ 'no-useless-return': 'error',
111
+ 'no-var': 'error',
112
+ 'no-void': 'error',
113
+ 'no-with': 'error',
114
+ 'object-shorthand': ['error', 'always'],
115
+ 'prefer-arrow-callback': 'error',
116
+ 'prefer-const': 'error',
117
+ quotes: ['error', 'single'],
118
+ radix: 'error',
119
+ 'require-unicode-regexp': 'error',
120
+ strict: 'error',
121
+ // 'valid-jsdoc': [
122
+ // 'error',
123
+ // {
124
+ // requireReturn: false,
125
+ // },
126
+ // ],
127
+ },
128
+ settings: {
129
+ 'import/resolver': {
130
+ typescript: true,
131
+ node: true,
132
+ },
133
+ },
134
+ },
135
+ ...testConfig,
136
+ ...tsConfig,
137
+ ];
@@ -0,0 +1,39 @@
1
+ import mochaPlugin from 'eslint-plugin-mocha';
2
+
3
+ export default [
4
+ mochaPlugin.configs.flat.recommended,
5
+
6
+ {
7
+ files: ['**/*.test.+(t|j)s'],
8
+
9
+ // env: {
10
+ // mocha: true,
11
+ // },
12
+ // plugins: ['mocha'],
13
+ languageOptions: {
14
+ globals: {
15
+ // added by mocha
16
+ test: 'readonly',
17
+ // added by chai
18
+ chai: 'readonly',
19
+ assert: 'readonly',
20
+ expect: 'readonly',
21
+ // added by test-fixture-mocha
22
+ fixture: 'readonly',
23
+ // added by sinon
24
+ sinon: 'readonly',
25
+ // added by wct-mocha
26
+ WCT: 'readonly',
27
+ flush: 'readonly',
28
+ },
29
+ },
30
+ rules: {
31
+ // tests can be as long as they need to be
32
+ 'max-lines-per-function': 'off',
33
+ 'max-statements': 'off',
34
+ // for chai expect syntax: `expect().to.be.ok`
35
+ 'no-unused-expressions': 'off',
36
+ 'mocha/no-mocha-arrows': 'off',
37
+ },
38
+ },
39
+ ];
@@ -0,0 +1,18 @@
1
+ import tseslint from 'typescript-eslint';
2
+
3
+ export default [
4
+ ...tseslint.configs.recommended,
5
+ {
6
+ name: 'ts-overrides',
7
+ files: ['**/*.+(ts|tsx)'],
8
+ rules: {
9
+ 'import/named': 'off',
10
+ 'no-unused-vars': 'off',
11
+ '@typescript-eslint/no-unused-vars': 'error',
12
+ '@typescript-eslint/no-explicit-any': 'warn',
13
+ 'import/group-exports': 'off',
14
+ 'new-cap': 'off',
15
+ 'func-style': 'off',
16
+ },
17
+ },
18
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cfg",
3
- "version": "1.56.0",
3
+ "version": "2.0.0",
4
4
  "description": "Configuration for Neovici packages",
5
5
  "homepage": "https://github.com/Neovici/cfg#readme",
6
6
  "bugs": {
@@ -15,7 +15,9 @@
15
15
  "main": "index.js",
16
16
  "files": [
17
17
  "eslint/*.js",
18
+ "eslint/*.mjs",
18
19
  "prettier/*.js",
20
+ "prettier/*.mjs",
19
21
  "web/*.js",
20
22
  "web/*.mjs",
21
23
  "*.js"
@@ -44,23 +46,25 @@
44
46
  ]
45
47
  },
46
48
  "dependencies": {
49
+ "@eslint/eslintrc": "^3.2.0",
50
+ "@eslint/js": "^9.18.0",
47
51
  "@playwright/test": "^1.40.1",
48
- "@typescript-eslint/eslint-plugin": "^7.0.0 || ^8.0.0",
49
- "@typescript-eslint/parser": "^7.0.0 || ^8.0.0",
50
52
  "@web/dev-server": "^0.4.0",
51
53
  "@web/dev-server-esbuild": "^1.0.0",
52
- "@web/test-runner": "^0.18.0",
54
+ "@web/test-runner": "^0.19.0",
53
55
  "@web/test-runner-commands": "^0.9.0",
54
56
  "@web/test-runner-playwright": "^0.11.0",
55
- "eslint": "^8.0.0 || ^9.0.0",
56
- "eslint-config-prettier": "^9.0.0",
57
+ "eslint": "^9.0.0",
58
+ "eslint-config-prettier": "^10.0.0",
57
59
  "eslint-import-resolver-alias": "^1.1.2",
58
60
  "eslint-import-resolver-typescript": "^3.2.7",
59
- "eslint-plugin-html": "^8.0.0",
61
+ "eslint-plugin-html": "^8.1.2",
60
62
  "eslint-plugin-import": "^2.25.0",
61
63
  "eslint-plugin-mocha": "^10.0.0",
64
+ "globals": "^15.14.0",
62
65
  "prettier": "^3.0.0",
63
- "typescript": "^5.1.0"
66
+ "typescript": "^5.1.0",
67
+ "typescript-eslint": "^8.20.0"
64
68
  },
65
69
  "devDependencies": {
66
70
  "@commitlint/cli": "^19.0.0",
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  singleQuote: true,
3
3
  useTabs: true,
4
4
  };
package/eslint/index.js DELETED
@@ -1,130 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es6: true,
5
- },
6
- parserOptions: {
7
- ecmaVersion: 'latest',
8
- },
9
- plugins: ['html'],
10
- extends: ['eslint:recommended', 'plugin:import/recommended', 'prettier'],
11
- rules: {
12
- 'accessor-pairs': 'error',
13
- 'array-callback-return': 'warn',
14
- 'block-scoped-var': 'error',
15
- camelcase: 'error',
16
- complexity: ['warn', 20],
17
- 'consistent-this': ['error', 'that'],
18
- 'constructor-super': 'error',
19
- curly: ['error', 'multi-line'],
20
- eqeqeq: ['error', 'smart'],
21
- 'func-name-matching': ['error', 'always'],
22
- 'func-names': ['error', 'never'],
23
- 'func-style': ['error', 'expression'],
24
- 'guard-for-in': 'error',
25
- 'import/no-extraneous-dependencies': 'warn',
26
- 'max-depth': ['error', 4],
27
- 'max-len': [
28
- 'warn',
29
- {
30
- code: 160,
31
- tabWidth: 2,
32
- },
33
- ],
34
- 'max-lines': [
35
- 'warn',
36
- {
37
- max: 350,
38
- skipBlankLines: true,
39
- skipComments: true,
40
- },
41
- ],
42
- 'max-nested-callbacks': ['error', 5],
43
- 'max-params': ['error', 5],
44
- 'max-statements': ['warn', 15],
45
- 'max-statements-per-line': [
46
- 'error',
47
- {
48
- max: 1,
49
- },
50
- ],
51
- 'new-cap': [
52
- 'error',
53
- {
54
- capIsNew: true,
55
- newIsCap: true,
56
- },
57
- ],
58
- 'no-alert': 'error',
59
- 'no-console': 'error',
60
- 'no-debugger': 'error',
61
- 'no-bitwise': 'error',
62
- 'no-const-assign': 'error',
63
- 'no-dupe-class-members': 'error',
64
- 'no-duplicate-imports': 'error',
65
- 'no-else-return': 'error',
66
- 'no-empty': 'error',
67
- 'no-empty-function': 'error',
68
- 'no-eval': 'error',
69
- 'no-extra-bind': 'error',
70
- 'no-global-assign': 'error',
71
- 'no-implicit-globals': 'error',
72
- 'no-invalid-this': 'error',
73
- 'no-labels': 'error',
74
- 'no-lone-blocks': 'error',
75
- 'no-lonely-if': 'error',
76
- 'no-loop-func': 'error',
77
- 'no-new': 'error',
78
- 'no-new-func': 'error',
79
- 'no-nested-ternary': 'error',
80
- 'no-param-reassign': 'error',
81
- 'no-redeclare': 'error',
82
- 'no-return-assign': 'error',
83
- 'no-self-compare': 'error',
84
- 'no-sequences': 'error',
85
- 'no-template-curly-in-string': 'error',
86
- 'no-this-before-super': 'error',
87
- 'no-throw-literal': 'error',
88
- 'no-undef-init': 'error',
89
- 'no-unmodified-loop-condition': 'error',
90
- 'no-unneeded-ternary': 'error',
91
- 'no-unused-expressions': 'error',
92
- 'no-unused-vars': 'error',
93
- 'no-use-before-define': 'error',
94
- 'no-useless-call': 'error',
95
- 'no-useless-computed-key': 'error',
96
- 'no-useless-concat': 'error',
97
- 'no-useless-return': 'error',
98
- 'no-var': 'error',
99
- 'no-void': 'error',
100
- 'no-with': 'error',
101
- 'object-shorthand': ['error', 'always'],
102
- 'prefer-arrow-callback': 'error',
103
- 'prefer-const': 'error',
104
- quotes: ['error', 'single'],
105
- radix: 'error',
106
- 'require-unicode-regexp': 'error',
107
- strict: 'error',
108
- 'valid-jsdoc': [
109
- 'error',
110
- {
111
- requireReturn: false,
112
- },
113
- ],
114
- },
115
- overrides: [
116
- {
117
- files: '**/*.+(ts|tsx)',
118
- extends: './typescript',
119
- },
120
- {
121
- files: ['**/*.test.+(t|j)s'],
122
- extends: './test',
123
- },
124
- ],
125
- settings: {
126
- 'import/resolver': {
127
- typescript: {},
128
- },
129
- },
130
- };
package/eslint/test.js DELETED
@@ -1,28 +0,0 @@
1
- module.exports = {
2
- env: {
3
- mocha: true
4
- },
5
- plugins: ['mocha'],
6
- globals: {
7
- // added by mocha
8
- test: 'readonly',
9
- // added by chai
10
- chai: 'readonly',
11
- assert: 'readonly',
12
- expect: 'readonly',
13
- // added by test-fixture-mocha
14
- fixture: 'readonly',
15
- // added by sinon
16
- sinon: 'readonly',
17
- // added by wct-mocha
18
- WCT: 'readonly',
19
- flush: 'readonly'
20
- },
21
- rules: {
22
- // tests can be as long as they need to be
23
- 'max-lines-per-function': 'off',
24
- 'max-statements': 'off',
25
- // for chai expect syntax: `expect().to.be.ok`
26
- 'no-unused-expressions': 'off'
27
- }
28
- };
@@ -1,16 +0,0 @@
1
- module.exports = {
2
- parser: '@typescript-eslint/parser',
3
- plugins: ['@typescript-eslint'],
4
- extends: [
5
- 'plugin:@typescript-eslint/recommended',
6
- 'plugin:import/typescript',
7
- ],
8
- rules: {
9
- 'no-unused-vars': 'off',
10
- '@typescript-eslint/no-unused-vars': 'error',
11
- '@typescript-eslint/no-explicit-any': 'warn',
12
- 'import/group-exports': 'off',
13
- 'new-cap': 'off',
14
- 'func-style': 'off'
15
- },
16
- };