@w5s/eslint-config 1.0.0-alpha.45 → 1.0.0-alpha.47

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.
Files changed (74) hide show
  1. package/es.js +1 -16
  2. package/functional.js +7 -10
  3. package/ignore.js +1 -40
  4. package/index.js +7 -7
  5. package/jest.js +1 -1
  6. package/json.js +1 -1
  7. package/lib/_rule.d.ts +5 -0
  8. package/lib/_rule.js +44 -0
  9. package/lib/_rule.js.map +1 -0
  10. package/lib/es/base.d.ts +5 -0
  11. package/lib/es/base.js +68 -0
  12. package/lib/es/base.js.map +1 -0
  13. package/lib/es/import.d.ts +4 -0
  14. package/lib/es/import.js +50 -0
  15. package/lib/es/import.js.map +1 -0
  16. package/lib/es/jsdoc.d.ts +4 -0
  17. package/lib/es/jsdoc.js +21 -0
  18. package/lib/es/jsdoc.js.map +1 -0
  19. package/lib/es/promise.d.ts +4 -0
  20. package/lib/es/promise.js +13 -0
  21. package/lib/es/promise.js.map +1 -0
  22. package/lib/es/unicorn.d.ts +4 -0
  23. package/lib/es/unicorn.js +74 -0
  24. package/lib/es/unicorn.js.map +1 -0
  25. package/lib/es.d.ts +4 -0
  26. package/lib/es.js +16 -0
  27. package/lib/es.js.map +1 -0
  28. package/lib/ignore.d.ts +4 -0
  29. package/lib/ignore.js +41 -0
  30. package/lib/ignore.js.map +1 -0
  31. package/lib/jest.d.ts +4 -0
  32. package/lib/jest.js +58 -0
  33. package/lib/jest.js.map +1 -0
  34. package/lib/jsonc.d.ts +4 -0
  35. package/lib/jsonc.js +184 -0
  36. package/lib/jsonc.js.map +1 -0
  37. package/lib/prettier.d.ts +4 -0
  38. package/lib/prettier.js +44 -0
  39. package/lib/prettier.js.map +1 -0
  40. package/lib/react.d.ts +4 -0
  41. package/lib/react.js +177 -0
  42. package/lib/react.js.map +1 -0
  43. package/lib/typescript.d.ts +4 -0
  44. package/lib/typescript.js +248 -0
  45. package/lib/typescript.js.map +1 -0
  46. package/lib/yml.d.ts +4 -0
  47. package/lib/yml.js +8 -0
  48. package/lib/yml.js.map +1 -0
  49. package/package.json +16 -3
  50. package/react.js +1 -1
  51. package/{rules/_rule.js → src/_rule.ts} +14 -31
  52. package/src/es/base.ts +80 -0
  53. package/src/es/import.ts +53 -0
  54. package/src/es/jsdoc.ts +22 -0
  55. package/src/es/promise.ts +13 -0
  56. package/src/es/unicorn.ts +75 -0
  57. package/src/es.ts +18 -0
  58. package/src/ignore.ts +41 -0
  59. package/src/jest.ts +61 -0
  60. package/{rules/jsonc.js → src/jsonc.ts} +7 -4
  61. package/src/prettier.ts +47 -0
  62. package/src/react.ts +177 -0
  63. package/{rules/typescript.js → src/typescript.ts} +103 -97
  64. package/{rules/yml.js → src/yml.ts} +4 -2
  65. package/ts.js +3 -30
  66. package/yml.js +1 -1
  67. package/rules/base.js +0 -53
  68. package/rules/import.js +0 -32
  69. package/rules/jest.js +0 -59
  70. package/rules/jsdoc.js +0 -20
  71. package/rules/prettier.js +0 -44
  72. package/rules/promise.js +0 -11
  73. package/rules/react.js +0 -176
  74. package/rules/unicorn.js +0 -70
package/es.js CHANGED
@@ -1,19 +1,4 @@
1
1
  // http://eslint.org/docs/user-guide/configuring
2
2
  module.exports = {
3
- extends: [
4
- require.resolve('./rules/base'),
5
- require.resolve('./rules/promise'),
6
- require.resolve('./rules/jsdoc'),
7
- require.resolve('./rules/import'),
8
- require.resolve('./rules/unicorn'),
9
- require.resolve('./rules/prettier'),
10
- ],
11
- parser: 'espree',
12
- parserOptions: {
13
- ecmaFeatures: {
14
- jsx: true,
15
- },
16
- ecmaVersion: 2022,
17
- sourceType: 'module',
18
- },
3
+ extends: [require.resolve('./lib/es.js'), require.resolve('./lib/prettier.js')],
19
4
  };
package/functional.js CHANGED
@@ -1,7 +1,5 @@
1
1
  // @see https://github.com/danielnixon/eslint-config-typed-fp/blob/master/src/index.ts
2
2
 
3
- const { off, error } = require('./rules/_rule.js');
4
-
5
3
  module.exports = {
6
4
  overrides: [
7
5
  {
@@ -12,19 +10,18 @@ module.exports = {
12
10
  ],
13
11
  rules: {
14
12
  'functional/functional-parameters': [
15
- error,
13
+ 'error',
16
14
  {
17
15
  allowArgumentsKeyword: false,
18
16
  allowRestParameter: false,
19
17
  enforceParameterCount: false,
20
18
  },
21
19
  ],
22
-
23
- 'functional/no-conditional-statement': off,
24
- 'functional/no-method-signature': off,
20
+ 'functional/no-conditional-statement': 'off',
21
+ 'functional/no-method-signature': 'off',
25
22
  'functional/prefer-readonly-type': [
26
23
  // @see https://github.com/jonaskello/eslint-plugin-functional/issues/51
27
- off, // error
24
+ 'off', // error
28
25
  {
29
26
  // When you call methods like `filter` and `concat` on an array (_even a readonly_ array) you always get back a mutable array.
30
27
  // By default prefer-readonly-type won't catch these cases, but with the checkImplicit option on it will.
@@ -34,15 +31,15 @@ module.exports = {
34
31
  checkImplicit: true,
35
32
  },
36
33
  ],
37
- 'functional/prefer-type-literal': off,
34
+ 'functional/prefer-type-literal': 'off',
38
35
  'total-functions/no-unsafe-readonly-mutable-assignment': [
39
36
  // @see https://github.com/danielnixon/eslint-plugin-total-functions/issues?q=is%3Aissue+is%3Aopen+no-unsafe-readonly-mutable-assignment
40
- off,
37
+ 'off',
41
38
  ],
42
39
 
43
40
  'total-functions/no-unsafe-type-assertion': [
44
41
  // Don't need this given consistent-type-assertions bans type assertions entirely.,
45
- off,
42
+ 'off',
46
43
  ],
47
44
  },
48
45
  },
package/ignore.js CHANGED
@@ -1,40 +1 @@
1
- // @ts-ignore
2
- const fs = require('node:fs');
3
- const findUp = require('find-up');
4
- // @ts-ignore
5
- const parseGitignore = require('parse-gitignore');
6
-
7
- const getGitignore = () => {
8
- const found = findUp.sync('.gitignore');
9
- if (found) {
10
- return parseGitignore.parse(fs.readFileSync(found)).patterns;
11
- }
12
-
13
- return [];
14
- };
15
-
16
- module.exports = {
17
- ignorePatterns: [
18
- '!.*',
19
- '.yarn',
20
- '.common/',
21
- '.config/package-lock.json',
22
- '.config/yarn.lock',
23
- '.go/',
24
- '.modules/',
25
- '.pnpm-store/',
26
- '.venv/',
27
- 'deprecated/',
28
- 'angular.json',
29
- 'esbuild.js',
30
- 'package-lock.json',
31
- 'pnpm-lock.yaml',
32
- 'slim.report.json',
33
- 'test-output/',
34
- 'venv/',
35
- 'yarn.lock',
36
- '_generated_/',
37
- '*.toml',
38
- ...getGitignore(),
39
- ],
40
- };
1
+ module.exports = require('./lib/ignore.js');
package/index.js CHANGED
@@ -22,13 +22,13 @@ function includeIf(condition, value) {
22
22
 
23
23
  module.exports = {
24
24
  extends: [
25
- require.resolve('./ignore'),
26
- require.resolve('./es'),
27
- ...includeIf(tryResolve('typescript'), require.resolve('./ts')),
28
- require.resolve('./json'),
29
- require.resolve('./yml'),
30
- require.resolve('./jest'),
31
- ...includeIf(tryResolve('react'), require.resolve('./react')),
25
+ require.resolve('./ignore.js'),
26
+ require.resolve('./es.js'),
27
+ ...includeIf(tryResolve('typescript'), require.resolve('./ts.js')),
28
+ require.resolve('./json.js'),
29
+ require.resolve('./yml.js'),
30
+ require.resolve('./jest.js'),
31
+ ...includeIf(tryResolve('react'), require.resolve('./react.js')),
32
32
  ],
33
33
  root: true,
34
34
  };
package/jest.js CHANGED
@@ -2,7 +2,7 @@
2
2
  module.exports = {
3
3
  overrides: [
4
4
  {
5
- extends: [require.resolve('./rules/jest')],
5
+ extends: [require.resolve('./lib/jest.js')],
6
6
  files: [
7
7
  '**/__mocks__/**/*.+(ts|tsx|js|jsx)',
8
8
  '**/__tests__/**/*.+(ts|tsx|js|jsx)',
package/json.js CHANGED
@@ -3,7 +3,7 @@
3
3
  module.exports = {
4
4
  overrides: [
5
5
  {
6
- extends: [require.resolve('./rules/jsonc.js')],
6
+ extends: [require.resolve('./lib/jsonc.js')],
7
7
  files: ['*.json', '*.json5', '*.jsonc'],
8
8
  },
9
9
  ],
package/lib/_rule.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import type { ESLint, Linter } from 'eslint';
2
+ export declare function concatESConfig(...configs: ESLint.ConfigData[]): ESLint.ConfigData;
3
+ export declare function fixme(_status: Linter.RuleLevel | [Linter.RuleLevel, ...any[]] | undefined): "off";
4
+ export declare function disable(_status: Linter.RuleLevel | [Linter.RuleLevel, ...any[]] | undefined, _explanation: string): "off";
5
+ //# sourceMappingURL=_rule.d.ts.map
package/lib/_rule.js ADDED
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.disable = exports.fixme = exports.concatESConfig = void 0;
4
+ function toArray(value) {
5
+ if (value == null) {
6
+ return [];
7
+ }
8
+ if (Array.isArray(value)) {
9
+ return value;
10
+ }
11
+ return [value];
12
+ }
13
+ function concatArray(left, right) {
14
+ return toArray(left).concat(toArray(right));
15
+ }
16
+ function concatESConfig(...configs) {
17
+ return configs.reduce((returnValue, config) => Object.assign({}, returnValue, config, {
18
+ env: Object.assign({}, returnValue.env, config.env),
19
+ globals: Object.assign({}, returnValue.globals, config.globals),
20
+ parserOptions: Object.assign({}, returnValue.parserOptions, config.parserOptions),
21
+ extends: concatArray(returnValue.extends, config.extends),
22
+ overrides: concatArray(returnValue.overrides, config.overrides),
23
+ plugins: concatArray(returnValue.plugins, config.plugins),
24
+ rules: Object.assign({}, returnValue.rules, config.rules),
25
+ settings: Object.assign({}, returnValue.settings, config.settings),
26
+ }), {
27
+ env: {},
28
+ extends: [],
29
+ overrides: [],
30
+ plugins: [],
31
+ rules: {},
32
+ settings: {},
33
+ });
34
+ }
35
+ exports.concatESConfig = concatESConfig;
36
+ function fixme(_status) {
37
+ return 'off';
38
+ }
39
+ exports.fixme = fixme;
40
+ function disable(_status, _explanation) {
41
+ return 'off';
42
+ }
43
+ exports.disable = disable;
44
+ //# sourceMappingURL=_rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_rule.js","sourceRoot":"","sources":["../src/_rule.ts"],"names":[],"mappings":";;;AAEA,SAAS,OAAO,CAAI,KAA0B;IAC5C,IAAI,KAAK,I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CAAC,QAAQ,CAAC;KACnE,CAAC,EACJ;QACE,GAAG,EAAE,EAAE;QACP,OAAO,EAAE,EAAE;QACX,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,EAAE;KACb,CACF,CAAC;AACJ,CAAC;AAtBD,wCAsBC;AAED,SAAgB,KAAK,CAAC,OAAoE;IACxF,OAAO,KAAc,CAAC;AACxB,CAAC;AAFD,sBAEC;AAED,SAAgB,OAAO,CAAC,OAAoE,EAAE,YAAoB;IAChH,OAAO,KAAc,CAAC;AACxB,CAAC;AAFD,0BAEC"}
@@ -0,0 +1,5 @@
1
+ import type eslint from 'eslint';
2
+ import '@rushstack/eslint-patch/modern-module-resolution.js';
3
+ declare const config: eslint.Linter.Config;
4
+ export = config;
5
+ //# sourceMappingURL=base.d.ts.map
package/lib/es/base.js ADDED
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ const dev_1 = require("@w5s/dev");
6
+ const _rule_js_1 = require("../_rule.js");
7
+ // Fix eslint shareable config (https://github.com/eslint/eslint/issues/3458)
8
+ // @ts-ignore No typing available
9
+ require("@rushstack/eslint-patch/modern-module-resolution.js");
10
+ // @ts-ignore No typing available
11
+ const best_practices_1 = __importDefault(require("eslint-config-airbnb-base/rules/best-practices"));
12
+ // @ts-ignore No typing available
13
+ const errors_1 = __importDefault(require("eslint-config-airbnb-base/rules/errors"));
14
+ // @ts-ignore No typing available
15
+ const es6_1 = __importDefault(require("eslint-config-airbnb-base/rules/es6"));
16
+ // @ts-ignore No typing available
17
+ const node_1 = __importDefault(require("eslint-config-airbnb-base/rules/node"));
18
+ // @ts-ignore No typing available
19
+ const strict_1 = __importDefault(require("eslint-config-airbnb-base/rules/strict"));
20
+ // @ts-ignore No typing available
21
+ const style_1 = __importDefault(require("eslint-config-airbnb-base/rules/style"));
22
+ // @ts-ignore No typing available
23
+ const variables_1 = __importDefault(require("eslint-config-airbnb-base/rules/variables"));
24
+ const baseConfig = (0, _rule_js_1.concatESConfig)(best_practices_1.default, errors_1.default, es6_1.default, node_1.default, strict_1.default, style_1.default, variables_1.default);
25
+ const config = (0, _rule_js_1.concatESConfig)(baseConfig,
26
+ // overrides
27
+ {
28
+ env: {
29
+ [`es${dev_1.ECMA_VERSION}`]: true,
30
+ },
31
+ globals: {
32
+ __DEV__: 'readonly',
33
+ __PROD__: 'readonly',
34
+ __TEST__: 'readonly',
35
+ },
36
+ parser: 'espree',
37
+ parserOptions: {
38
+ ecmaFeatures: {
39
+ jsx: true,
40
+ },
41
+ ecmaVersion: dev_1.ECMA_VERSION,
42
+ sourceType: 'module',
43
+ },
44
+ reportUnusedDisableDirectives: true,
45
+ rules: {
46
+ // Annoying because it is not always wanted
47
+ 'default-case': 'off',
48
+ // We do not want console.* in production. Disable this rule on a per line basis if needed
49
+ 'no-console': 'error',
50
+ // Often useful in jsx
51
+ 'no-nested-ternary': 'off',
52
+ // Too strict, for pure code prefer the functional plugin
53
+ 'no-param-reassign': ['error', { props: false }],
54
+ // Allow for-of syntax
55
+ // @ts-ignore No typing available
56
+ 'no-restricted-syntax': baseConfig.rules['no-restricted-syntax'].filter(
57
+ // @ts-ignore No typing available
58
+ ({ selector }) => selector !== 'ForOfStatement'),
59
+ // underscore is often used (mongodb, etc)
60
+ 'no-underscore-dangle': 'off',
61
+ // Ignore underscore case arguments
62
+ 'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
63
+ // Allow in some cases https://github.com/airbnb/javascript/issues/1089#issuecomment-1024351821
64
+ 'no-use-before-define': ['error', 'nofunc'],
65
+ },
66
+ });
67
+ module.exports = config;
68
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/es/base.ts"],"names":[],"mappings":";;;;AAEA,kCAAwC;AACxC,0CAA6C;AAE7C,6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EAAE,KAAK;QAC7B,mCAAmC;QACnC,gBAAgB,EAAE,CAAC,OAAO,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;QACxD,+FAA+F;QAC/F,sBAAsB,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;KAC5C;CACF,CACF,CAAC;AAEF,iBAAS,MAAM,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type eslint from 'eslint';
2
+ declare const config: eslint.Linter.Config;
3
+ export = config;
4
+ //# sourceMappingURL=import.d.ts.map
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ const dev_1 = require("@w5s/dev");
6
+ // @ts-ignore
7
+ const imports_1 = __importDefault(require("eslint-config-airbnb-base/rules/imports"));
8
+ const _rule_js_1 = require("../_rule.js");
9
+ // @see https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import
10
+ const config = (0, _rule_js_1.concatESConfig)(
11
+ // @ts-ignore
12
+ imports_1.default,
13
+ // Overrides
14
+ {
15
+ rules: {
16
+ 'import/extensions': [
17
+ 'error',
18
+ 'ignorePackages',
19
+ {
20
+ // js: 'never',
21
+ // jsx: 'never',
22
+ // mjs: 'never',
23
+ },
24
+ ],
25
+ 'import/no-deprecated': (0, _rule_js_1.disable)('warn', 'performance'),
26
+ 'import/no-named-as-default': (0, _rule_js_1.disable)('warn', 'performance'),
27
+ 'import/no-unused-modules': (0, _rule_js_1.disable)('warn', 'performance'),
28
+ 'import/prefer-default-export': 'off',
29
+ 'import/unambiguous': (0, _rule_js_1.fixme)('off'), // Disable because proposal still in progress
30
+ },
31
+ settings: {
32
+ 'import/ignore': [...dev_1.IGNORE_LIST, dev_1.EXTENSIONS_RESOURCES_REGEX],
33
+ // Append 'ts' extensions to Airbnb 'import/extensions' setting
34
+ 'import/extensions': dev_1.EXTENSIONS,
35
+ // Resolve type definition packages
36
+ 'import/external-module-folders': ['node_modules', 'node_modules/@types'],
37
+ // Apply special parsing for TypeScript files
38
+ 'import/parsers': {
39
+ '@typescript-eslint/parser': dev_1.EXTENSIONS.filter((ext) => !ext.includes('js')),
40
+ },
41
+ // Append 'ts' extensions to Airbnb 'import/resolver' setting
42
+ 'import/resolver': {
43
+ node: {
44
+ extensions: [...dev_1.EXTENSIONS, '.json'],
45
+ },
46
+ },
47
+ },
48
+ });
49
+ module.exports = config;
50
+ //# sourceMappingURL=import.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import.js","sourceRoot":"","sources":["../../src/es/import.ts"],"names":[],"mappings":";;;;AAAA,kCAA+E;AAE/E,aAAa;AACb,sFAAmE;AACnE,0CAA6D;AAE7D,mIAAmI;AAEnI,MAAM,MAAM,GAAyB,IAAA,yBAAc;AACjD,aAAa;AACb,iBAAY;AACZ,YAAY;AACZ;IACE,KAAK,EAAE;QACL,mBAAmB,EAAE;YACnB,OAAO;YACP,gBAAgB;YAChB;YACE,eAAe;YACf,gBAAgB;YAChB,gBAAgB;aACjB;SACF;QACD,sBAAsB,EAAE,IAAA,kBAAO,EAAC,MAAM,EAAE,aAAa,CAAC;QACtD,4BAA4B,EAAE,IAAA,kBAAO,EAAC,MAAM,EAAE,aAAa,CAAC;QAC5D,0BAA0B,EAAE,IAAA,kBAAO,EAAC,MAAM,EAAE,aAAa,CAAC;QAC1D,8BAA8B,EAAE,KAAK;QACrC,oBAAoB,EAAE,IAAA,gBAAK,EAAC,KAAK,CAAC,EAAE,6CAA6C;KAClF;IACD,QAAQ,EAAE;QACR,eAAe,EAAE,CAAC,GAAG,iBAAW,EAAE,gCAA0B,CAAC;QAE7D,+DAA+D;QAC/D,mBAAmB,EAAE,gBAAU;QAE/B,mCAAmC;QACnC,gCAAgC,EAAE,CAAC,cAAc,EAAE,qBAAqB,CAAC;QAEzE,6CAA6C;QAC7C,gBAAgB,EAAE;YAChB,2BAA2B,EAAE,gBAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;SAC7E;QACD,6DAA6D;QAC7D,iBAAiB,EAAE;YACjB,IAAI,EAAE;gBACJ,UAAU,EAAE,CAAC,GAAG,gBAAU,EAAE,OAAO,CAAC;aACrC;SACF;KACF;CACF,CACF,CAAC;AAEF,iBAAS,MAAM,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type eslint from 'eslint';
2
+ declare const config: eslint.Linter.Config;
3
+ export = config;
4
+ //# sourceMappingURL=jsdoc.d.ts.map
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ const config = {
3
+ extends: ['plugin:jsdoc/recommended'],
4
+ plugins: ['jsdoc'],
5
+ rules: {
6
+ 'jsdoc/no-undefined-types': 'off',
7
+ 'jsdoc/require-hyphen-before-param-description': ['warn', 'always'],
8
+ 'jsdoc/require-jsdoc': 'off',
9
+ 'jsdoc/require-param-description': 'off',
10
+ 'jsdoc/require-returns': 'off',
11
+ 'jsdoc/valid-types': 'off',
12
+ strict: ['error', 'safe'],
13
+ },
14
+ settings: {
15
+ jsdoc: {
16
+ mode: 'typescript',
17
+ },
18
+ },
19
+ };
20
+ module.exports = config;
21
+ //# sourceMappingURL=jsdoc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsdoc.js","sourceRoot":"","sources":["../../src/es/jsdoc.ts"],"names":[],"mappings":";AAEA,MAAM,MAAM,GAAyB;IACnC,OAAO,EAAE,CAAC,0BAA0B,CAAC;IACrC,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,0BAA0B,EAAE,KAAK;QACjC,+CAA+C,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;QACnE,qBAAqB,EAAE,KAAK;QAC5B,iCAAiC,EAAE,KAAK;QACxC,uBAAuB,EAAE,KAAK;QAC9B,mBAAmB,EAAE,KAAK;QAC1B,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;KAC1B;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,IAAI,EAAE,YAAY;SACnB;KACF;CACF,CAAC;AAEF,iBAAS,MAAM,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type eslint from 'eslint';
2
+ declare const config: eslint.Linter.Config;
3
+ export = config;
4
+ //# sourceMappingURL=promise.d.ts.map
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ const _rule_js_1 = require("../_rule.js");
3
+ const config = (0, _rule_js_1.concatESConfig)({
4
+ extends: ['plugin:promise/recommended'],
5
+ plugins: ['promise'],
6
+ rules: {
7
+ // https://github.com/xjamundx/eslint-plugin-promise/issues/212
8
+ 'promise/prefer-await-to-callbacks': (0, _rule_js_1.fixme)('error'),
9
+ 'promise/prefer-await-to-then': 'error',
10
+ },
11
+ });
12
+ module.exports = config;
13
+ //# sourceMappingURL=promise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promise.js","sourceRoot":"","sources":["../../src/es/promise.ts"],"names":[],"mappings":";AACA,0CAAoD;AAEpD,MAAM,MAAM,GAAyB,IAAA,yBAAc,EAAC;IAClD,OAAO,EAAE,CAAC,4BAA4B,CAAC;IACvC,OAAO,EAAE,CAAC,SAAS,CAAC;IACpB,KAAK,EAAE;QACL,+DAA+D;QAC/D,mCAAmC,EAAE,IAAA,gBAAK,EAAC,OAAO,CAAC;QACnD,8BAA8B,EAAE,OAAO;KACxC;CACF,CAAC,CAAC;AACH,iBAAS,MAAM,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type eslint from 'eslint';
2
+ declare const config: eslint.Linter.Config;
3
+ export = config;
4
+ //# sourceMappingURL=unicorn.d.ts.map
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ // @ts-ignore unicorn config is not typed
6
+ const recommended_js_1 = __importDefault(require("eslint-plugin-unicorn/configs/recommended.js"));
7
+ const _rule_js_1 = require("../_rule.js");
8
+ const config = (0, _rule_js_1.concatESConfig)(recommended_js_1.default, {
9
+ // extends: ['plugin:unicorn/recommended'],
10
+ plugins: ['unicorn'],
11
+ rules: {
12
+ 'unicode-bom': ['error', 'never'],
13
+ 'unicorn/better-regex': 'error',
14
+ 'unicorn/catch-error-name': ['error', { name: 'error' }],
15
+ 'unicorn/custom-error-definition': 'error',
16
+ 'unicorn/error-message': 'error',
17
+ 'unicorn/explicit-length-check': ['error', { 'non-zero': 'greater-than' }],
18
+ 'unicorn/filename-case': 'off',
19
+ 'unicorn/import-index': 'off',
20
+ 'unicorn/new-for-builtins': 'off',
21
+ 'unicorn/no-abusive-eslint-disable': 'error',
22
+ 'unicorn/no-array-instanceof': 'error',
23
+ 'unicorn/no-console-spaces': 'off',
24
+ 'unicorn/no-fn-reference-in-iterator': 'off',
25
+ 'unicorn/no-for-loop': 'error',
26
+ 'unicorn/no-hex-escape': 'error',
27
+ 'unicorn/no-new-buffer': 'error',
28
+ 'unicorn/no-null': 'off',
29
+ 'unicorn/no-process-exit': 'off',
30
+ 'unicorn/no-unreadable-array-destructuring': 'off',
31
+ 'unicorn/no-unsafe-regex': 'error',
32
+ 'unicorn/no-unused-properties': 'warn',
33
+ 'unicorn/no-useless-undefined': 'off',
34
+ 'unicorn/no-zero-fractions': 'error',
35
+ 'unicorn/number-literal-case': 'error',
36
+ 'unicorn/prefer-add-event-listener': 'off',
37
+ 'unicorn/prefer-event-key': 'error',
38
+ 'unicorn/prefer-exponentiation-operator': 'error',
39
+ 'unicorn/prefer-flat-map': 'error',
40
+ 'unicorn/prefer-includes': 'error',
41
+ 'unicorn/prefer-node-append': 'error',
42
+ 'unicorn/prefer-node-remove': 'error',
43
+ 'unicorn/prefer-number-properties': 'error',
44
+ 'unicorn/prefer-query-selector': 'error',
45
+ 'unicorn/prefer-set-has': 'off',
46
+ 'unicorn/prefer-spread': 'off',
47
+ 'unicorn/prefer-starts-ends-with': 'error',
48
+ 'unicorn/prefer-text-content': 'error',
49
+ 'unicorn/prefer-type-error': 'error',
50
+ 'unicorn/throw-new-error': 'error',
51
+ },
52
+ }, {
53
+ overrides: [
54
+ {
55
+ files: ['**/*.config.cjs', '**/*.config.js'],
56
+ rules: {
57
+ 'unicorn/prefer-module': 'off',
58
+ },
59
+ },
60
+ ],
61
+ rules: {
62
+ 'unicorn/consistent-destructuring': 'off',
63
+ 'unicorn/consistent-function-scoping': 'off',
64
+ 'unicorn/no-array-callback-reference': 'off',
65
+ 'unicorn/no-array-for-each': 'off',
66
+ 'unicorn/no-array-method-this-argument': 'off',
67
+ 'unicorn/no-array-reduce': 'off',
68
+ 'unicorn/no-object-as-default-parameter': 'off',
69
+ 'unicorn/prefer-default-parameters': 'off',
70
+ 'unicorn/prevent-abbreviations': 'off', // This rule is so dangerous : it potentially break code while fixing in many cases !!
71
+ },
72
+ });
73
+ module.exports = config;
74
+ //# sourceMappingURL=unicorn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unicorn.js","sourceRoot":"","sources":["../../src/es/unicorn.ts"],"names":[],"mappings":";;;;AACA,yCAAyC;AACzC,kGAAyE;AACzE,0CAA6C;AAE7C,MAAM,MAAM,GAAyB,IAAA,yBAAc,EACjD,wBAAa,EACb;IACE,2CAA2C;IAC3C,OAAO,EAAE,CAAC,SAAS,CAAC;IACpB,KAAK,EAAE;QACL,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;QACjC,sBAAsB,EAAE,OAAO;QAC/B,0BAA0B,EAAE,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QACxD,iCAAiC,EAAE,OAAO;QAC1C,uBAAuB,EAAE,OAAO;QAChC,+BAA+B,EAAE,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;QAC1E,uBAAuB,EAAE,KAAK;QAC9B,sBAAsB,EAAE,KAAK;QAC7B,0BAA0B,EAAE,KAAK;QACjC,mCAAmC,EAA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C;AACF,iBAAS,MAAM,CAAC"}
package/lib/es.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type eslint from 'eslint';
2
+ declare const config: eslint.Linter.Config;
3
+ export = config;
4
+ //# sourceMappingURL=es.d.ts.map
package/lib/es.js ADDED
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ const _rule_js_1 = require("./_rule.js");
6
+ const base_js_1 = __importDefault(require("./es/base.js"));
7
+ const promise_js_1 = __importDefault(require("./es/promise.js"));
8
+ const jsdoc_js_1 = __importDefault(require("./es/jsdoc.js"));
9
+ const import_js_1 = __importDefault(require("./es/import.js"));
10
+ const unicorn_js_1 = __importDefault(require("./es/unicorn.js"));
11
+ // import prettierConfig from './prettier.js';
12
+ const config = (0, _rule_js_1.concatESConfig)(base_js_1.default, promise_js_1.default, jsdoc_js_1.default, import_js_1.default, unicorn_js_1.default
13
+ // prettierConfig
14
+ );
15
+ module.exports = config;
16
+ //# sourceMappingURL=es.js.map
package/lib/es.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"es.js","sourceRoot":"","sources":["../src/es.ts"],"names":[],"mappings":";;;;AACA,yCAA4C;AAC5C,2DAAsC;AACtC,iEAA4C;AAC5C,6DAAwC;AACxC,+DAA0C;AAC1C,iEAA4C;AAC5C,8CAA8C;AAE9C,MAAM,MAAM,GAAyB,IAAA,yBAAc,EACjD,iBAAU,EACV,oBAAa,EACb,kBAAW,EACX,mBAAY,EACZ,oBAAa;AACb,iBAAiB;CAClB,CAAC;AACF,iBAAS,MAAM,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type eslint from 'eslint';
2
+ declare const config: eslint.Linter.Config;
3
+ export = config;
4
+ //# sourceMappingURL=ignore.d.ts.map
package/lib/ignore.js ADDED
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ const node_fs_1 = require("node:fs");
6
+ const find_up_1 = __importDefault(require("find-up"));
7
+ const parse_gitignore_1 = __importDefault(require("parse-gitignore"));
8
+ const getGitignore = () => {
9
+ const found = find_up_1.default.sync('.gitignore');
10
+ if (found != null) {
11
+ return parse_gitignore_1.default.parse((0, node_fs_1.readFileSync)(found)).patterns;
12
+ }
13
+ return [];
14
+ };
15
+ const config = {
16
+ ignorePatterns: [
17
+ '!.*',
18
+ '.yarn',
19
+ '.common/',
20
+ '.config/package-lock.json',
21
+ '.config/yarn.lock',
22
+ '.go/',
23
+ '.modules/',
24
+ '.pnpm-store/',
25
+ '.venv/',
26
+ 'deprecated/',
27
+ 'angular.json',
28
+ 'esbuild.js',
29
+ 'package-lock.json',
30
+ 'pnpm-lock.yaml',
31
+ 'slim.report.json',
32
+ 'test-output/',
33
+ 'venv/',
34
+ 'yarn.lock',
35
+ '_generated_/',
36
+ '*.toml',
37
+ ...getGitignore(),
38
+ ],
39
+ };
40
+ module.exports = config;
41
+ //# sourceMappingURL=ignore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ignore.js","sourceRoot":"","sources":["../src/ignore.ts"],"names":[],"mappings":";;;;AACA,qCAAuC;AACvC,sDAA6B;AAC7B,sEAA6C;AAE7C,MAAM,YAAY,GAAG,GAAG,EAAE;IACxB,MAAM,KAAK,GAAG,iBAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACxC,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,yBAAc,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;KAC3D;IAED,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAyB;IACnC,cAAc,EAAE;QACd,KAAK;QACL,OAAO;QACP,UAAU;QACV,2BAA2B;QAC3B,mBAAmB;QACnB,MAAM;QACN,WAAW;QACX,cAAc;QACd,QAAQ;QACR,aAAa;QACb,cAAc;QACd,YAAY;QACZ,mBAAmB;QACnB,gBAAgB;QAChB,kBAAkB;QAClB,cAAc;QACd,OAAO;QACP,WAAW;QACX,cAAc;QACd,QAAQ;QACR,GAAG,YAAY,EAAE;KAClB;CACF,CAAC;AAEF,iBAAS,MAAM,CAAC"}
package/lib/jest.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type eslint from 'eslint';
2
+ declare const config: eslint.Linter.Config;
3
+ export = config;
4
+ //# sourceMappingURL=jest.d.ts.map
package/lib/jest.js ADDED
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ const _rule_js_1 = require("./_rule.js");
3
+ const config = (0, _rule_js_1.concatESConfig)({
4
+ env: {
5
+ 'jest/globals': true,
6
+ },
7
+ extends: ['plugin:jest/recommended'],
8
+ globals: {
9
+ context: true,
10
+ },
11
+ plugins: ['jest'],
12
+ rules: {
13
+ 'jest/consistent-test-it': 'error',
14
+ 'jest/expect-expect': 'off',
15
+ 'jest/no-alias-methods': 'error',
16
+ 'jest/prefer-spy-on': 'error',
17
+ 'jest/prefer-to-contain': 'error',
18
+ 'jest/valid-title': ['error', { ignoreTypeOfDescribeName: true }],
19
+ },
20
+ settings: {
21
+ jest: {
22
+ // Compatibility with mocha, cypress, etc.
23
+ globalAliases: {
24
+ describe: ['context'],
25
+ fdescribe: ['fcontext'],
26
+ xdescribe: ['xcontext'],
27
+ },
28
+ version: 'latest',
29
+ },
30
+ },
31
+ },
32
+ /**
33
+ * Unicorn less strict to help writing tests
34
+ */
35
+ {
36
+ rules: {
37
+ 'unicorn/consistent-function-scoping': 'off',
38
+ 'unicorn/no-useless-undefined': 'off',
39
+ 'unicorn/prefer-module': 'off',
40
+ },
41
+ },
42
+ /**
43
+ * Typescript config is set to be less strict because we often have "hack", "mock" in tests
44
+ */
45
+ {
46
+ rules: {
47
+ '@typescript-eslint/naming-convention': 'off',
48
+ '@typescript-eslint/no-non-null-assertion': 'off',
49
+ '@typescript-eslint/no-unsafe-assignment': 'off',
50
+ '@typescript-eslint/no-unsafe-call': 'off',
51
+ '@typescript-eslint/no-unsafe-member-access': 'off',
52
+ '@typescript-eslint/no-unsafe-return': 'off',
53
+ '@typescript-eslint/restrict-template-expressions': 'off',
54
+ '@typescript-eslint/unbound-method': 'off',
55
+ },
56
+ });
57
+ module.exports = config;
58
+ //# sourceMappingURL=jest.js.map