@nice-move/eslint-config-base 0.11.34 → 0.12.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/lib/node.cjs DELETED
@@ -1,146 +0,0 @@
1
- 'use strict';
2
-
3
- const { configHas } = require('./utils.cjs');
4
-
5
- const commonjs =
6
- configHas(
7
- ({ commonjs: globs = [] }) => globs,
8
- (globs) => globs,
9
- ) || [];
10
-
11
- module.exports = {
12
- plugins: ['n'],
13
- rules: {
14
- 'n/hashbang': 'error',
15
- 'n/no-process-env': 'error',
16
- 'n/no-path-concat': 'error',
17
- },
18
- overrides: [
19
- {
20
- files: '**/*',
21
- excludedFiles: ['*.cjs', '*.cts', ...commonjs],
22
- rules: {
23
- 'import/no-commonjs': 'error',
24
- },
25
- },
26
- {
27
- files: '*.nb.*',
28
- env: {
29
- browser: false,
30
- node: true,
31
- commonjs: true,
32
- },
33
- rules: {
34
- 'no-unused-vars': 'warn',
35
- 'import/no-extraneous-dependencies': 'off',
36
- 'import/no-commonjs': 'off',
37
- 'import/no-nodejs-modules': 'off',
38
- 'unicorn/prefer-module': 'off',
39
- },
40
- },
41
- {
42
- files: '*.{m,c}{t,j}s',
43
- excludedFiles: '*.nb.*',
44
- env: {
45
- node: true,
46
- },
47
- rules: {
48
- 'n/no-deprecated-api': 'error',
49
- 'n/no-process-env': 'off',
50
- 'n/no-process-exit': 'warn',
51
- 'n/no-unsupported-features/es-builtins': 'error',
52
- 'n/no-unsupported-features/es-syntax': 'error',
53
- 'n/no-unsupported-features/node-builtins': 'error',
54
- 'n/prefer-global/buffer': 'warn',
55
- 'n/prefer-global/console': 'warn',
56
- 'n/prefer-global/process': 'warn',
57
- 'n/prefer-global/url-search-params': 'warn',
58
- 'n/prefer-global/url': 'warn',
59
- 'n/process-exit-as-throw': 'error',
60
- },
61
- },
62
- {
63
- files: '*.*',
64
- excludedFiles: [
65
- '*.{m,c}ts',
66
- '*.cjs',
67
- '*.md',
68
- '*.nb.*',
69
- '*.ts',
70
- '**/*.md/*',
71
- ...commonjs,
72
- ],
73
- rules: {
74
- 'n/file-extension-in-import': 'error',
75
- },
76
- },
77
- {
78
- files: ['*.mjs', '*.js'],
79
- parser: '@babel/eslint-parser',
80
- parserOptions: {
81
- requireConfigFile: false,
82
- babelOptions: {
83
- babelrc: false,
84
- configFile: false,
85
- plugins: [require.resolve('@babel/plugin-syntax-import-attributes')],
86
- },
87
- },
88
- },
89
- {
90
- files: ['*.jsx'],
91
- parser: '@babel/eslint-parser',
92
- parserOptions: {
93
- requireConfigFile: false,
94
- babelOptions: {
95
- babelrc: false,
96
- configFile: false,
97
- plugins: [
98
- require.resolve('@babel/plugin-syntax-jsx'),
99
- require.resolve('@babel/plugin-syntax-import-attributes'),
100
- ],
101
- },
102
- },
103
- },
104
- {
105
- // for node.js
106
- files: ['*.mjs', '*.mts'],
107
- excludedFiles: '*.nb.*',
108
- env: {
109
- browser: false,
110
- commonjs: false,
111
- },
112
- globals: {
113
- __dirname: 'off',
114
- __filename: 'off',
115
- exports: 'off',
116
- module: 'off',
117
- require: 'off',
118
- },
119
- },
120
- {
121
- files: ['*.cjs', ...commonjs],
122
- excludedFiles: '*.nb.*',
123
- env: {
124
- browser: false,
125
- commonjs: true,
126
- },
127
- parserOptions: {
128
- ecmaFeatures: {
129
- impliedStrict: false,
130
- },
131
- sourceType: 'script',
132
- },
133
- rules: {
134
- strict: ['error', 'global'],
135
- 'n/no-exports-assign': 'error',
136
- 'n/no-new-require': 'error',
137
- },
138
- },
139
- {
140
- files: ['*.cjs', '*.cts'],
141
- rules: {
142
- 'unicorn/prefer-module': 'off',
143
- },
144
- },
145
- ],
146
- };
@@ -1,19 +0,0 @@
1
- 'use strict';
2
-
3
- const { pkgHas } = require('./utils.cjs');
4
-
5
- module.exports =
6
- pkgHas(
7
- ({ peerDependencies: { '@playwright/test': playwright } = {} }) =>
8
- playwright,
9
- () => ({
10
- overrides: [
11
- {
12
- files: 'test/**',
13
- settings: {
14
- 'import/core-modules': ['@playwright/test'],
15
- },
16
- },
17
- ],
18
- }),
19
- ) || {};
package/lib/promise.cjs DELETED
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- extends: 'plugin:promise/recommended',
5
- rules: {
6
- 'promise/always-return': 'off',
7
- 'promise/catch-or-return': ['warn', { allowFinally: true }],
8
- 'promise/no-callback-in-promise': 'off',
9
- },
10
- };
package/lib/test.cjs DELETED
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- const { reaching } = require('settingz');
4
-
5
- const { configs: { recommended: { rules } = {} } = {} } = reaching(
6
- 'eslint-plugin-ava/index.js',
7
- );
8
-
9
- module.exports = {
10
- overrides: [
11
- {
12
- files: [
13
- '**/{test,tests,spec,specs}/**/*.{m,c,}{j,t}s',
14
- '*.{test,spec}.{m,c,}{j,t}s}',
15
- ],
16
- plugins: rules ? ['ava'] : undefined,
17
- rules: {
18
- ...rules,
19
- 'unicorn/no-empty-file': 0,
20
- 'ava/no-ignored-test-files': 0,
21
- },
22
- },
23
- ],
24
- };
@@ -1,51 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- overrides: [
5
- {
6
- files: ['*.ts', '*.tsx', '*.mts', '*.cts'],
7
- parser: '@typescript-eslint/parser',
8
- plugins: ['@typescript-eslint/eslint-plugin'],
9
- // extends: [
10
- // 'plugin:@typescript-eslint/recommended-requiring-type-checking',
11
- // 'airbnb-typescript',
12
- // ],
13
- rules: {
14
- '@typescript-eslint/no-array-constructor': 'error',
15
- '@typescript-eslint/no-duplicate-enum-values': 'error',
16
- '@typescript-eslint/no-dynamic-delete': 'error',
17
- '@typescript-eslint/no-extra-non-null-assertion': 'error',
18
- '@typescript-eslint/no-extraneous-class': 'error',
19
- '@typescript-eslint/no-invalid-void-type': 'error',
20
- '@typescript-eslint/no-loss-of-precision': 'error',
21
- '@typescript-eslint/no-misused-new': 'error',
22
- '@typescript-eslint/no-namespace': 'error',
23
- '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
24
- '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
25
- '@typescript-eslint/no-non-null-assertion': 'error',
26
- '@typescript-eslint/no-this-alias': 'error',
27
- '@typescript-eslint/no-unnecessary-type-constraint': 'error',
28
- '@typescript-eslint/no-unsafe-declaration-merging': 'error',
29
- '@typescript-eslint/no-useless-constructor': 'error',
30
- '@typescript-eslint/no-var-requires': 'error',
31
- '@typescript-eslint/prefer-as-const': 'error',
32
- '@typescript-eslint/prefer-literal-enum-member': 'error',
33
- '@typescript-eslint/prefer-ts-expect-error': 'error',
34
- '@typescript-eslint/triple-slash-reference': 'error',
35
- '@typescript-eslint/unified-signatures': 'error',
36
-
37
- '@typescript-eslint/no-explicit-any': 'warn',
38
- '@typescript-eslint/ban-ts-comment': 0,
39
- '@typescript-eslint/no-empty-function': 0,
40
- '@typescript-eslint/no-unused-vars': [
41
- 'warn',
42
- {
43
- argsIgnorePattern: '^_+$',
44
- ignoreRestSiblings: true,
45
- varsIgnorePattern: '^_+$',
46
- },
47
- ],
48
- },
49
- },
50
- ],
51
- };
package/lib/unicorn.cjs DELETED
@@ -1,27 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- extends: ['plugin:unicorn/recommended'],
5
- rules: {
6
- 'unicorn/consistent-destructuring': 'off',
7
- 'unicorn/custom-error-definition': 'warn',
8
- 'unicorn/expiring-todo-comments': 'off',
9
- 'unicorn/import-style': 'off',
10
- 'unicorn/no-array-for-each': 'off',
11
- 'unicorn/no-array-reduce': 'off',
12
- 'unicorn/no-null': 'off',
13
- 'unicorn/numeric-separators-style': [
14
- 'warn',
15
- { onlyIfContainsSeparator: true },
16
- ],
17
- 'unicorn/prefer-export-from': ['error', { ignoreUsedVariables: true }],
18
- 'unicorn/prefer-global-this': 0,
19
- 'unicorn/prefer-prototype-methods': 'off',
20
- 'unicorn/prefer-set-has': 'off',
21
- 'unicorn/prefer-top-level-await': 'off',
22
- 'unicorn/prevent-abbreviations': 'off',
23
- 'unicorn/relative-url-style': ['error', 'always'],
24
- 'unicorn/require-post-message-target-origin': 'off',
25
- 'unicorn/template-indent': 'off',
26
- },
27
- };
package/lib/utils.cjs DELETED
@@ -1,34 +0,0 @@
1
- 'use strict';
2
-
3
- const { getPkg } = require('settingz');
4
-
5
- // eslint-disable-next-line consistent-return
6
- function pkgHas(checker, getResult) {
7
- const pkg = getPkg();
8
-
9
- const io = checker(pkg);
10
-
11
- if (io) {
12
- return getResult(io, pkg);
13
- }
14
- }
15
-
16
- // eslint-disable-next-line consistent-return
17
- function configHas(checker, getResult) {
18
- const pkg = getPkg('nice-move');
19
-
20
- const io = checker(pkg);
21
-
22
- if (io) {
23
- return getResult(io, pkg);
24
- }
25
- }
26
-
27
- module.exports = {
28
- pkgHas,
29
- configHas,
30
- matches: {
31
- sourceAndPackages: '{src,packages/*}/**',
32
- source: 'src/**',
33
- },
34
- };