@apitree.cz/eslint-config 0.1.0-next.05dd9cd

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 (84) hide show
  1. package/README.md +57 -0
  2. package/dist/base/config.d.ts +51 -0
  3. package/dist/base/config.js +46 -0
  4. package/dist/base/config.js.map +1 -0
  5. package/dist/base/overrides/index.d.ts +25 -0
  6. package/dist/base/overrides/index.js +8 -0
  7. package/dist/base/overrides/index.js.map +1 -0
  8. package/dist/base/overrides/javascript.d.ts +6 -0
  9. package/dist/base/overrides/javascript.js +10 -0
  10. package/dist/base/overrides/javascript.js.map +1 -0
  11. package/dist/base/overrides/tests.d.ts +8 -0
  12. package/dist/base/overrides/tests.js +12 -0
  13. package/dist/base/overrides/tests.js.map +1 -0
  14. package/dist/base/overrides/typescript.d.ts +13 -0
  15. package/dist/base/overrides/typescript.js +20 -0
  16. package/dist/base/overrides/typescript.js.map +1 -0
  17. package/dist/base/rules/common.d.ts +2 -0
  18. package/dist/base/rules/common.js +50 -0
  19. package/dist/base/rules/common.js.map +1 -0
  20. package/dist/base/rules/imports.d.ts +2 -0
  21. package/dist/base/rules/imports.js +23 -0
  22. package/dist/base/rules/imports.js.map +1 -0
  23. package/dist/base/rules/index.d.ts +3 -0
  24. package/dist/base/rules/index.js +14 -0
  25. package/dist/base/rules/index.js.map +1 -0
  26. package/dist/base/rules/typescript.d.ts +2 -0
  27. package/dist/base/rules/typescript.js +8 -0
  28. package/dist/base/rules/typescript.js.map +1 -0
  29. package/dist/base/rules/unicorn.d.ts +2 -0
  30. package/dist/base/rules/unicorn.js +33 -0
  31. package/dist/base/rules/unicorn.js.map +1 -0
  32. package/dist/base.d.ts +2 -0
  33. package/dist/base.js +4 -0
  34. package/dist/base.js.map +1 -0
  35. package/dist/constants.d.ts +2 -0
  36. package/dist/constants.js +12 -0
  37. package/dist/constants.js.map +1 -0
  38. package/dist/index.d.ts +4 -0
  39. package/dist/index.js +5 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/nextjs/config.d.ts +29 -0
  42. package/dist/nextjs/config.js +10 -0
  43. package/dist/nextjs/config.js.map +1 -0
  44. package/dist/nextjs/overrides.d.ts +25 -0
  45. package/dist/nextjs/overrides.js +30 -0
  46. package/dist/nextjs/overrides.js.map +1 -0
  47. package/dist/nextjs.d.ts +30 -0
  48. package/dist/nextjs.js +7 -0
  49. package/dist/nextjs.js.map +1 -0
  50. package/dist/react/config.d.ts +24 -0
  51. package/dist/react/config.js +26 -0
  52. package/dist/react/config.js.map +1 -0
  53. package/dist/react/overrides/index.d.ts +1 -0
  54. package/dist/react/overrides/index.js +7 -0
  55. package/dist/react/overrides/index.js.map +1 -0
  56. package/dist/react/overrides/tests.d.ts +2 -0
  57. package/dist/react/overrides/tests.js +18 -0
  58. package/dist/react/overrides/tests.js.map +1 -0
  59. package/dist/react/overrides/typescript.d.ts +2 -0
  60. package/dist/react/overrides/typescript.js +9 -0
  61. package/dist/react/overrides/typescript.js.map +1 -0
  62. package/dist/react/rules/common.d.ts +2 -0
  63. package/dist/react/rules/common.js +16 -0
  64. package/dist/react/rules/common.js.map +1 -0
  65. package/dist/react/rules/hooks.d.ts +2 -0
  66. package/dist/react/rules/hooks.js +7 -0
  67. package/dist/react/rules/hooks.js.map +1 -0
  68. package/dist/react/rules/imports.d.ts +2 -0
  69. package/dist/react/rules/imports.js +9 -0
  70. package/dist/react/rules/imports.js.map +1 -0
  71. package/dist/react/rules/index.d.ts +3 -0
  72. package/dist/react/rules/index.js +14 -0
  73. package/dist/react/rules/index.js.map +1 -0
  74. package/dist/react/rules/jsx.d.ts +2 -0
  75. package/dist/react/rules/jsx.js +18 -0
  76. package/dist/react/rules/jsx.js.map +1 -0
  77. package/dist/react.d.ts +25 -0
  78. package/dist/react.js +7 -0
  79. package/dist/react.js.map +1 -0
  80. package/dist/utils.d.ts +3 -0
  81. package/dist/utils.js +27 -0
  82. package/dist/utils.js.map +1 -0
  83. package/index.js +1 -0
  84. package/package.json +64 -0
package/README.md ADDED
@@ -0,0 +1,57 @@
1
+ <div align="center">
2
+
3
+ <a href="https://github.com/ApiTreeCZ">
4
+ <img alt="ApiTree s.r.o." src="https://www.apitree.cz/static/images/logo-header.svg" width="120" />
5
+ </a>
6
+
7
+ # ESLint Config
8
+
9
+ ### [ESLint](https://eslint.org) configuration for ApiTree projects
10
+
11
+ </div>
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ pnpm add --save-dev @apitree.cz/eslint-config eslint
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ Use one of the following configurations in your `.eslintrc.cjs`:
22
+
23
+ ### Base
24
+
25
+ ```javascript
26
+ module.exports = {
27
+ extends: '@apitree.cz',
28
+ parserOptions: {
29
+ project: './tsconfig.json',
30
+ tsconfigRootDir: __dirname,
31
+ },
32
+ };
33
+ ```
34
+
35
+ ### React
36
+
37
+ ```javascript
38
+ module.exports = {
39
+ extends: '@apitree.cz/eslint-config/react',
40
+ parserOptions: {
41
+ project: './tsconfig.json',
42
+ tsconfigRootDir: __dirname,
43
+ },
44
+ };
45
+ ```
46
+
47
+ ### Next.js
48
+
49
+ ```javascript
50
+ module.exports = {
51
+ extends: '@apitree.cz/eslint-config/nextjs',
52
+ parserOptions: {
53
+ project: './tsconfig.json',
54
+ tsconfigRootDir: __dirname,
55
+ },
56
+ };
57
+ ```
@@ -0,0 +1,51 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const config: {
3
+ env: {
4
+ es2024: true;
5
+ node: true;
6
+ };
7
+ extends: string[];
8
+ ignorePatterns: string[];
9
+ parser: string;
10
+ parserOptions: {
11
+ ecmaFeatures: {
12
+ modules: boolean;
13
+ };
14
+ sourceType: "module";
15
+ };
16
+ plugins: string[];
17
+ rules: {
18
+ [x: string]: Linter.RuleEntry<any[]>;
19
+ };
20
+ overrides: ({
21
+ files: string;
22
+ rules: {
23
+ '@typescript-eslint/no-var-requires': "off";
24
+ };
25
+ } | {
26
+ files: string;
27
+ extends: string[];
28
+ rules: {
29
+ 'no-magic-numbers': "off";
30
+ 'unicorn/consistent-function-scoping': "off";
31
+ };
32
+ } | {
33
+ files: string[];
34
+ extends: string[];
35
+ rules: {
36
+ '@typescript-eslint/consistent-type-assertions': "error";
37
+ '@typescript-eslint/consistent-type-definitions': ["error", string];
38
+ '@typescript-eslint/consistent-type-exports': "error";
39
+ '@typescript-eslint/consistent-type-imports': "error";
40
+ '@typescript-eslint/no-empty-interface': "error";
41
+ '@typescript-eslint/no-unsafe-declaration-merging': "error";
42
+ '@typescript-eslint/sort-type-constituents': "error";
43
+ };
44
+ })[];
45
+ settings: {
46
+ 'import/extensions': readonly [".cjs", ".js", ".ts"];
47
+ 'import/resolver': {
48
+ typescript: {};
49
+ };
50
+ };
51
+ };
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.config = void 0;
4
+ const constants_1 = require("../constants");
5
+ const overrides_1 = require("./overrides");
6
+ const rules_1 = require("./rules");
7
+ exports.config = {
8
+ env: { es2024: true, node: true },
9
+ extends: [
10
+ 'plugin:@typescript-eslint/recommended',
11
+ 'plugin:import/typescript',
12
+ 'plugin:prettier/recommended',
13
+ 'plugin:unicorn/recommended',
14
+ 'prettier',
15
+ 'turbo',
16
+ ],
17
+ ignorePatterns: [
18
+ '.idea',
19
+ '.vscode',
20
+ 'build',
21
+ 'coverage',
22
+ 'dist',
23
+ 'node_modules',
24
+ ],
25
+ parser: '@typescript-eslint/parser',
26
+ parserOptions: {
27
+ ecmaFeatures: { modules: true },
28
+ sourceType: 'module',
29
+ },
30
+ plugins: [
31
+ '@typescript-eslint',
32
+ 'import',
33
+ 'prettier',
34
+ 'unicorn',
35
+ 'unused-imports',
36
+ 'prettier',
37
+ 'turbo',
38
+ ],
39
+ rules: rules_1.rules,
40
+ overrides: overrides_1.overrides,
41
+ settings: {
42
+ 'import/extensions': constants_1.importExtensions,
43
+ 'import/resolver': { typescript: {} },
44
+ },
45
+ };
46
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/base/config.ts"],"names":[],"mappings":";;;AAEA,4CAAgD;AAEhD,2CAAwC;AACxC,mCAAgC;AAEnB,QAAA,MAAM,GAAG;IACpB,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;IACjC,OAAO,EAAE;QACP,uCAAuC;QACvC,0BAA0B;QAC1B,6BAA6B;QAC7B,4BAA4B;QAC5B,UAAU;QACV,OAAO;KACR;IACD,cAAc,EAAE;QACd,OAAO;QACP,SAAS;QACT,OAAO;QACP,UAAU;QACV,MAAM;QACN,cAAc;KACf;IACD,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE;QACb,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC/B,UAAU,EAAE,QAAQ;KACrB;IACD,OAAO,EAAE;QACP,oBAAoB;QACpB,QAAQ;QACR,UAAU;QACV,SAAS;QACT,gBAAgB;QAChB,UAAU;QACV,OAAO;KACR;IACD,KAAK,EAAL,aAAK;IACL,SAAS,EAAT,qBAAS;IACT,QAAQ,EAAE;QACR,mBAAmB,EAAE,4BAAgB;QACrC,iBAAiB,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;KACtC;CACsB,CAAC"}
@@ -0,0 +1,25 @@
1
+ export declare const overrides: ({
2
+ files: string;
3
+ rules: {
4
+ '@typescript-eslint/no-var-requires': "off";
5
+ };
6
+ } | {
7
+ files: string;
8
+ extends: string[];
9
+ rules: {
10
+ 'no-magic-numbers': "off";
11
+ 'unicorn/consistent-function-scoping': "off";
12
+ };
13
+ } | {
14
+ files: string[];
15
+ extends: string[];
16
+ rules: {
17
+ '@typescript-eslint/consistent-type-assertions': "error";
18
+ '@typescript-eslint/consistent-type-definitions': ["error", string];
19
+ '@typescript-eslint/consistent-type-exports': "error";
20
+ '@typescript-eslint/consistent-type-imports': "error";
21
+ '@typescript-eslint/no-empty-interface': "error";
22
+ '@typescript-eslint/no-unsafe-declaration-merging': "error";
23
+ '@typescript-eslint/sort-type-constituents': "error";
24
+ };
25
+ })[];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.overrides = void 0;
4
+ const javascript_1 = require("./javascript");
5
+ const tests_1 = require("./tests");
6
+ const typescript_1 = require("./typescript");
7
+ exports.overrides = [javascript_1.javascript, typescript_1.typescript, tests_1.tests];
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/base/overrides/index.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,mCAAgC;AAChC,6CAA0C;AAG7B,QAAA,SAAS,GAAG,CAAC,uBAAU,EAAE,uBAAU,EAAE,aAAK,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const javascript: {
2
+ files: string;
3
+ rules: {
4
+ '@typescript-eslint/no-var-requires': "off";
5
+ };
6
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.javascript = void 0;
4
+ exports.javascript = {
5
+ files: '*.js',
6
+ rules: {
7
+ '@typescript-eslint/no-var-requires': 'off',
8
+ },
9
+ };
10
+ //# sourceMappingURL=javascript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"javascript.js","sourceRoot":"","sources":["../../../src/base/overrides/javascript.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE;QACL,oCAAoC,EAAE,KAAK;KAC5C;CAC8B,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const tests: {
2
+ files: string;
3
+ extends: string[];
4
+ rules: {
5
+ 'no-magic-numbers': "off";
6
+ 'unicorn/consistent-function-scoping': "off";
7
+ };
8
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tests = void 0;
4
+ exports.tests = {
5
+ files: '*.test.ts',
6
+ extends: ['plugin:vitest/recommended'],
7
+ rules: {
8
+ 'no-magic-numbers': 'off',
9
+ 'unicorn/consistent-function-scoping': 'off',
10
+ },
11
+ };
12
+ //# sourceMappingURL=tests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tests.js","sourceRoot":"","sources":["../../../src/base/overrides/tests.ts"],"names":[],"mappings":";;;AAEa,QAAA,KAAK,GAAG;IACnB,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,CAAC,2BAA2B,CAAC;IACtC,KAAK,EAAE;QACL,kBAAkB,EAAE,KAAK;QACzB,qCAAqC,EAAE,KAAK;KAC7C;CAC8B,CAAC"}
@@ -0,0 +1,13 @@
1
+ export declare const typescript: {
2
+ files: string[];
3
+ extends: string[];
4
+ rules: {
5
+ '@typescript-eslint/consistent-type-assertions': "error";
6
+ '@typescript-eslint/consistent-type-definitions': ["error", string];
7
+ '@typescript-eslint/consistent-type-exports': "error";
8
+ '@typescript-eslint/consistent-type-imports': "error";
9
+ '@typescript-eslint/no-empty-interface': "error";
10
+ '@typescript-eslint/no-unsafe-declaration-merging': "error";
11
+ '@typescript-eslint/sort-type-constituents': "error";
12
+ };
13
+ };
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.typescript = void 0;
4
+ exports.typescript = {
5
+ files: ['*.ts'],
6
+ extends: [
7
+ 'plugin:@typescript-eslint/recommended-requiring-type-checking',
8
+ 'plugin:@typescript-eslint/strict',
9
+ ],
10
+ rules: {
11
+ '@typescript-eslint/consistent-type-assertions': 'error',
12
+ '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
13
+ '@typescript-eslint/consistent-type-exports': 'error',
14
+ '@typescript-eslint/consistent-type-imports': 'error',
15
+ '@typescript-eslint/no-empty-interface': 'error',
16
+ '@typescript-eslint/no-unsafe-declaration-merging': 'error',
17
+ '@typescript-eslint/sort-type-constituents': 'error',
18
+ },
19
+ };
20
+ //# sourceMappingURL=typescript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../../src/base/overrides/typescript.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,KAAK,EAAE,CAAC,MAAM,CAAC;IACf,OAAO,EAAE;QACP,+DAA+D;QAC/D,kCAAkC;KACnC;IACD,KAAK,EAAE;QACL,+CAA+C,EAAE,OAAO;QACxD,gDAAgD,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;QACxE,4CAA4C,EAAE,OAAO;QACrD,4CAA4C,EAAE,OAAO;QACrD,uCAAuC,EAAE,OAAO;QAChD,kDAAkD,EAAE,OAAO;QAC3D,2CAA2C,EAAE,OAAO;KACrD;CAC8B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const common: Linter.RulesRecord;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.common = void 0;
4
+ exports.common = {
5
+ 'array-callback-return': [
6
+ 'error',
7
+ {
8
+ allowImplicit: true,
9
+ },
10
+ ],
11
+ 'arrow-body-style': ['error', 'as-needed'],
12
+ 'arrow-parens': ['error', 'always'],
13
+ 'comma-dangle': 'off',
14
+ 'consistent-return': 'off',
15
+ curly: ['error', 'multi-line'],
16
+ 'default-case': 'off',
17
+ 'function-paren-newline': 'off',
18
+ 'guard-for-in': 'off',
19
+ 'implicit-arrow-linebreak': 'off',
20
+ 'no-confusing-arrow': 'off',
21
+ 'no-console': 'warn',
22
+ 'no-debugger': 'warn',
23
+ 'no-magic-numbers': ['error', { ignore: [0, 1], ignoreArrayIndexes: true }],
24
+ 'no-multiple-empty-lines': ['error', { max: 1 }],
25
+ 'no-param-reassign': 'off',
26
+ 'no-restricted-exports': [
27
+ 'error',
28
+ {
29
+ restrictedNamedExports: [],
30
+ restrictDefaultExports: {
31
+ direct: false,
32
+ named: true,
33
+ defaultFrom: false,
34
+ namedFrom: false,
35
+ namespaceFrom: true,
36
+ },
37
+ },
38
+ ],
39
+ 'no-restricted-syntax': [
40
+ 'error',
41
+ 'ForInStatement',
42
+ 'LabeledStatement',
43
+ 'WithStatement',
44
+ ],
45
+ 'no-shadow': 'off',
46
+ 'no-use-before-define': 'off',
47
+ 'no-warning-comments': ['warn', { terms: ['fixme', 'todo'] }],
48
+ 'object-curly-newline': ['error', { consistent: true }],
49
+ };
50
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/base/rules/common.ts"],"names":[],"mappings":";;;AAEa,QAAA,MAAM,GAAuB;IACxC,uBAAuB,EAAE;QACvB,OAAO;QACP;YACE,aAAa,EAAE,IAAI;SACpB;KACF;IACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;IAC1C,cAAc,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;IACnC,cAAc,EAAE,KAAK;IACrB,mBAAmB,EAAE,KAAK;IAC1B,KAAK,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC;IAC9B,cAAc,EAAE,KAAK;IACrB,wBAAwB,EAAE,KAAK;IAC/B,cAAc,EAAE,KAAK;IACrB,0BAA0B,EAAE,KAAK;IACjC,oBAAoB,EAAE,KAAK;IAC3B,YAAY,EAAE,MAAM;IACpB,aAAa,EAAE,MAAM;IACrB,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;IAC3E,yBAAyB,EAAE,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;IAChD,mBAAmB,EAAE,KAAK;IAC1B,uBAAuB,EAAE;QACvB,OAAO;QACP;YACE,sBAAsB,EAAE,EAAE;YAC1B,sBAAsB,EAAE;gBACtB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,IAAI;gBACX,WAAW,EAAE,KAAK;gBAClB,SAAS,EAAE,KAAK;gBAChB,aAAa,EAAE,IAAI;aACpB;SACF;KACF;IACD,sBAAsB,EAAE;QACtB,OAAO;QACP,gBAAgB;QAChB,kBAAkB;QAClB,eAAe;KAChB;IACD,WAAW,EAAE,KAAK;IAClB,sBAAsB,EAAE,KAAK;IAC7B,qBAAqB,EAAE,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;IAC7D,sBAAsB,EAAE,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;CACxD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const imports: Linter.RulesRecord;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.imports = void 0;
4
+ const utils_1 = require("../../utils");
5
+ exports.imports = {
6
+ ...(0, utils_1.getImportExtensionsRule)(),
7
+ ...(0, utils_1.getExtraneousDependenciesRule)(),
8
+ 'import/order': [
9
+ 'error',
10
+ {
11
+ alphabetize: {
12
+ caseInsensitive: true,
13
+ order: 'asc',
14
+ },
15
+ groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
16
+ 'newlines-between': 'always',
17
+ },
18
+ ],
19
+ 'import/prefer-default-export': 'off',
20
+ 'unused-imports/no-unused-imports': 'error',
21
+ 'unused-imports/no-unused-vars': ['error', { ignoreRestSiblings: true }],
22
+ };
23
+ //# sourceMappingURL=imports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imports.js","sourceRoot":"","sources":["../../../src/base/rules/imports.ts"],"names":[],"mappings":";;;AAEA,uCAGqB;AAER,QAAA,OAAO,GAAuB;IACzC,GAAG,IAAA,+BAAuB,GAAE;IAC5B,GAAG,IAAA,qCAA6B,GAAE;IAClC,cAAc,EAAE;QACd,OAAO;QACP;YACE,WAAW,EAAE;gBACX,eAAe,EAAE,IAAI;gBACrB,KAAK,EAAE,KAAK;aACb;YACD,MAAM,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;YACzE,kBAAkB,EAAE,QAAQ;SAC7B;KACF;IACD,8BAA8B,EAAE,KAAK;IACrC,kCAAkC,EAAE,OAAO;IAC3C,+BAA+B,EAAE,CAAC,OAAO,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;CACzE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const rules: {
2
+ [x: string]: import("eslint").Linter.RuleEntry<any[]>;
3
+ };
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rules = void 0;
4
+ const common_1 = require("./common");
5
+ const imports_1 = require("./imports");
6
+ const typescript_1 = require("./typescript");
7
+ const unicorn_1 = require("./unicorn");
8
+ exports.rules = {
9
+ ...common_1.common,
10
+ ...imports_1.imports,
11
+ ...typescript_1.typescript,
12
+ ...unicorn_1.unicorn,
13
+ };
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/base/rules/index.ts"],"names":[],"mappings":";;;AAAA,qCAAkC;AAClC,uCAAoC;AACpC,6CAA0C;AAC1C,uCAAoC;AAEvB,QAAA,KAAK,GAAG;IACnB,GAAG,eAAM;IACT,GAAG,iBAAO;IACV,GAAG,uBAAU;IACb,GAAG,iBAAO;CACX,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const typescript: Linter.RulesRecord;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.typescript = void 0;
4
+ exports.typescript = {
5
+ '@typescript-eslint/no-unused-vars': 'off',
6
+ '@typescript-eslint/no-use-before-define': 'error',
7
+ };
8
+ //# sourceMappingURL=typescript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../../src/base/rules/typescript.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAuB;IAC5C,mCAAmC,EAAE,KAAK;IAC1C,yCAAyC,EAAE,OAAO;CACnD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const unicorn: Linter.RulesRecord;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.unicorn = void 0;
4
+ exports.unicorn = {
5
+ 'unicorn/no-array-callback-reference': 'off',
6
+ 'unicorn/prevent-abbreviations': [
7
+ 'error',
8
+ {
9
+ replacements: {
10
+ args: {
11
+ arguments: false,
12
+ },
13
+ docs: {
14
+ documents: false,
15
+ documentation: false,
16
+ },
17
+ params: {
18
+ parameters: false,
19
+ },
20
+ prop: {
21
+ property: false,
22
+ },
23
+ props: {
24
+ properties: false,
25
+ },
26
+ ref: {
27
+ reference: false,
28
+ },
29
+ },
30
+ },
31
+ ],
32
+ };
33
+ //# sourceMappingURL=unicorn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unicorn.js","sourceRoot":"","sources":["../../../src/base/rules/unicorn.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAuB;IACzC,qCAAqC,EAAE,KAAK;IAC5C,+BAA+B,EAAE;QAC/B,OAAO;QACP;YACE,YAAY,EAAE;gBACZ,IAAI,EAAE;oBACJ,SAAS,EAAE,KAAK;iBACjB;gBACD,IAAI,EAAE;oBACJ,SAAS,EAAE,KAAK;oBAChB,aAAa,EAAE,KAAK;iBACrB;gBACD,MAAM,EAAE;oBACN,UAAU,EAAE,KAAK;iBAClB;gBACD,IAAI,EAAE;oBACJ,QAAQ,EAAE,KAAK;iBAChB;gBACD,KAAK,EAAE;oBACL,UAAU,EAAE,KAAK;iBAClB;gBACD,GAAG,EAAE;oBACH,SAAS,EAAE,KAAK;iBACjB;aACF;SACF;KACF;CACF,CAAC"}
package/dist/base.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { config } from './base/config';
2
+ export = config;
package/dist/base.js ADDED
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ const config_1 = require("./base/config");
3
+ module.exports = config_1.config;
4
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":";AAAA,0CAAuC;AAEvC,iBAAS,eAAM,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const extraneousDependenciesPatterns: readonly ["*.config.js", "*.config.ts", "/scripts/**/*", "/tests/**/*", "/types/*.d.ts"];
2
+ export declare const importExtensions: readonly [".cjs", ".js", ".ts"];
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.importExtensions = exports.extraneousDependenciesPatterns = void 0;
4
+ exports.extraneousDependenciesPatterns = [
5
+ '*.config.js',
6
+ '*.config.ts',
7
+ '/scripts/**/*',
8
+ '/tests/**/*',
9
+ '/types/*.d.ts',
10
+ ];
11
+ exports.importExtensions = ['.cjs', '.js', '.ts'];
12
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,8BAA8B,GAAG;IAC5C,aAAa;IACb,aAAa;IACb,eAAe;IACf,aAAa;IACb,eAAe;CACP,CAAC;AAEE,QAAA,gBAAgB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ extends: string[];
3
+ };
4
+ export = _default;
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ module.exports = {
3
+ extends: ['airbnb-base', './base'],
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,iBAAS;IACP,OAAO,EAAE,CAAC,aAAa,EAAE,QAAQ,CAAC;CACX,CAAC"}
@@ -0,0 +1,29 @@
1
+ export declare const config: {
2
+ extends: string[];
3
+ plugins: string[];
4
+ overrides: ({
5
+ files: string;
6
+ rules: {
7
+ 'unicorn/prevent-abbreviations': "off";
8
+ 'react/function-component-definition'?: never;
9
+ 'react/jsx-props-no-spreading'?: never;
10
+ };
11
+ } | {
12
+ files: string[];
13
+ rules: {
14
+ 'react/function-component-definition': ["error", {
15
+ namedComponents: string[];
16
+ unnamedComponents: string;
17
+ }];
18
+ 'unicorn/prevent-abbreviations'?: never;
19
+ 'react/jsx-props-no-spreading'?: never;
20
+ };
21
+ } | {
22
+ files: string[];
23
+ rules: {
24
+ 'react/jsx-props-no-spreading': "off";
25
+ 'unicorn/prevent-abbreviations'?: never;
26
+ 'react/function-component-definition'?: never;
27
+ };
28
+ })[];
29
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.config = void 0;
4
+ const overrides_1 = require("./overrides");
5
+ exports.config = {
6
+ extends: ['plugin:@next/next/recommended'],
7
+ plugins: ['@next/next'],
8
+ overrides: overrides_1.overrides,
9
+ };
10
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/nextjs/config.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,OAAO,EAAE,CAAC,+BAA+B,CAAC;IAC1C,OAAO,EAAE,CAAC,YAAY,CAAC;IACvB,SAAS,EAAT,qBAAS;CACc,CAAC"}
@@ -0,0 +1,25 @@
1
+ export declare const overrides: ({
2
+ files: string;
3
+ rules: {
4
+ 'unicorn/prevent-abbreviations': "off";
5
+ 'react/function-component-definition'?: never;
6
+ 'react/jsx-props-no-spreading'?: never;
7
+ };
8
+ } | {
9
+ files: string[];
10
+ rules: {
11
+ 'react/function-component-definition': ["error", {
12
+ namedComponents: string[];
13
+ unnamedComponents: string;
14
+ }];
15
+ 'unicorn/prevent-abbreviations'?: never;
16
+ 'react/jsx-props-no-spreading'?: never;
17
+ };
18
+ } | {
19
+ files: string[];
20
+ rules: {
21
+ 'react/jsx-props-no-spreading': "off";
22
+ 'unicorn/prevent-abbreviations'?: never;
23
+ 'react/function-component-definition'?: never;
24
+ };
25
+ })[];
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.overrides = void 0;
4
+ exports.overrides = [
5
+ {
6
+ files: 'next-env.d.ts',
7
+ rules: {
8
+ 'unicorn/prevent-abbreviations': 'off',
9
+ },
10
+ },
11
+ {
12
+ files: ['src/pages/**/*.ts', 'src/pages/**/*.tsx'],
13
+ rules: {
14
+ 'react/function-component-definition': [
15
+ 'error',
16
+ {
17
+ namedComponents: ['arrow-function', 'function-declaration'],
18
+ unnamedComponents: 'function-expression',
19
+ },
20
+ ],
21
+ },
22
+ },
23
+ {
24
+ files: ['src/pages/_app.tsx', 'src/pages/_document.tsx'],
25
+ rules: {
26
+ 'react/jsx-props-no-spreading': 'off',
27
+ },
28
+ },
29
+ ];
30
+ //# sourceMappingURL=overrides.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../src/nextjs/overrides.ts"],"names":[],"mappings":";;;AAEa,QAAA,SAAS,GAAG;IACvB;QACE,KAAK,EAAE,eAAe;QACtB,KAAK,EAAE;YACL,+BAA+B,EAAE,KAAK;SACvC;KACF;IACD;QACE,KAAK,EAAE,CAAC,mBAAmB,EAAE,oBAAoB,CAAC;QAClD,KAAK,EAAE;YACL,qCAAqC,EAAE;gBACrC,OAAO;gBACP;oBACE,eAAe,EAAE,CAAC,gBAAgB,EAAE,sBAAsB,CAAC;oBAC3D,iBAAiB,EAAE,qBAAqB;iBACzC;aACF;SACF;KACF;IACD;QACE,KAAK,EAAE,CAAC,oBAAoB,EAAE,yBAAyB,CAAC;QACxD,KAAK,EAAE;YACL,8BAA8B,EAAE,KAAK;SACtC;KACF;CACgC,CAAC"}
@@ -0,0 +1,30 @@
1
+ declare const _default: {
2
+ extends: string[];
3
+ plugins: string[];
4
+ overrides: ({
5
+ files: string;
6
+ rules: {
7
+ 'unicorn/prevent-abbreviations': "off";
8
+ 'react/function-component-definition'?: never;
9
+ 'react/jsx-props-no-spreading'?: never;
10
+ };
11
+ } | {
12
+ files: string[];
13
+ rules: {
14
+ 'react/function-component-definition': ["error", {
15
+ namedComponents: string[];
16
+ unnamedComponents: string;
17
+ }];
18
+ 'unicorn/prevent-abbreviations'?: never;
19
+ 'react/jsx-props-no-spreading'?: never;
20
+ };
21
+ } | {
22
+ files: string[];
23
+ rules: {
24
+ 'react/jsx-props-no-spreading': "off";
25
+ 'unicorn/prevent-abbreviations'?: never;
26
+ 'react/function-component-definition'?: never;
27
+ };
28
+ })[];
29
+ };
30
+ export = _default;
package/dist/nextjs.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ const config_1 = require("./nextjs/config");
3
+ module.exports = {
4
+ ...config_1.config,
5
+ extends: ['./react', ...config_1.config.extends],
6
+ };
7
+ //# sourceMappingURL=nextjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nextjs.js","sourceRoot":"","sources":["../src/nextjs.ts"],"names":[],"mappings":";AAEA,4CAAyC;AAEzC,iBAAS;IACP,GAAG,eAAM;IACT,OAAO,EAAE,CAAC,SAAS,EAAE,GAAG,eAAM,CAAC,OAAO,CAAC;CAChB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const config: {
3
+ env: {
4
+ browser: true;
5
+ };
6
+ extends: string[];
7
+ plugins: string[];
8
+ parserOptions: {
9
+ ecmaFeatures: {
10
+ jsx: true;
11
+ };
12
+ jsxPragma: null;
13
+ };
14
+ rules: {
15
+ [x: string]: Linter.RuleEntry<any[]>;
16
+ };
17
+ overrides: Linter.ConfigOverride<Linter.RulesRecord>[];
18
+ settings: {
19
+ 'import/extensions': string[];
20
+ react: {
21
+ version: string;
22
+ };
23
+ };
24
+ };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.config = void 0;
4
+ const constants_1 = require("../constants");
5
+ const overrides_1 = require("./overrides");
6
+ const rules_1 = require("./rules");
7
+ exports.config = {
8
+ env: { browser: true },
9
+ extends: [
10
+ 'plugin:react-hooks/recommended',
11
+ 'plugin:react/jsx-runtime',
12
+ 'plugin:storybook/recommended',
13
+ ],
14
+ plugins: ['react', 'react-hooks', 'storybook'],
15
+ parserOptions: {
16
+ ecmaFeatures: { jsx: true },
17
+ jsxPragma: null,
18
+ },
19
+ rules: rules_1.rules,
20
+ overrides: overrides_1.overrides,
21
+ settings: {
22
+ 'import/extensions': [...constants_1.importExtensions, '.tsx'],
23
+ react: { version: 'detect' },
24
+ },
25
+ };
26
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/react/config.ts"],"names":[],"mappings":";;;AAEA,4CAAgD;AAEhD,2CAAwC;AACxC,mCAAgC;AAEnB,QAAA,MAAM,GAAG;IACpB,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;IACtB,OAAO,EAAE;QACP,gCAAgC;QAChC,0BAA0B;QAC1B,8BAA8B;KAC/B;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,WAAW,CAAC;IAC9C,aAAa,EAAE;QACb,YAAY,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE;QAC3B,SAAS,EAAE,IAAI;KAChB;IACD,KAAK,EAAL,aAAK;IACL,SAAS,EAAT,qBAAS;IACT,QAAQ,EAAE;QACR,mBAAmB,EAAE,CAAC,GAAG,4BAAgB,EAAE,MAAM,CAAC;QAClD,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;KAC7B;CACsB,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const overrides: import("eslint").Linter.ConfigOverride<import("eslint").Linter.RulesRecord>[];
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.overrides = void 0;
4
+ const tests_1 = require("./tests");
5
+ const typescript_1 = require("./typescript");
6
+ exports.overrides = [typescript_1.typescript, ...tests_1.tests];
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/overrides/index.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,6CAA0C;AAG7B,QAAA,SAAS,GAAG,CAAC,uBAAU,EAAE,GAAG,aAAK,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const tests: Linter.ConfigOverride[];
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tests = void 0;
4
+ const tests_1 = require("../../base/overrides/tests");
5
+ exports.tests = [
6
+ { ...tests_1.tests, files: [tests_1.tests.files, '*.test.tsx'] },
7
+ {
8
+ files: '*.test.tsx',
9
+ extends: ['plugin:jest-dom/recommended', 'plugin:testing-library/react'],
10
+ },
11
+ {
12
+ files: ['*.stories.tsx', '*.test.tsx'],
13
+ rules: {
14
+ 'react/jsx-props-no-spreading': 'off',
15
+ },
16
+ },
17
+ ];
18
+ //# sourceMappingURL=tests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tests.js","sourceRoot":"","sources":["../../../src/react/overrides/tests.ts"],"names":[],"mappings":";;;AAEA,sDAA2D;AAE9C,QAAA,KAAK,GAA4B;IAC5C,EAAE,GAAG,aAAI,EAAE,KAAK,EAAE,CAAC,aAAI,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE;IAC9C;QACE,KAAK,EAAE,YAAY;QACnB,OAAO,EAAE,CAAC,6BAA6B,EAAE,8BAA8B,CAAC;KACzE;IACD;QACE,KAAK,EAAE,CAAC,eAAe,EAAE,YAAY,CAAC;QACtC,KAAK,EAAE;YACL,8BAA8B,EAAE,KAAK;SACtC;KACF;CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const typescript: Linter.ConfigOverride;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.typescript = void 0;
4
+ const typescript_1 = require("../../base/overrides/typescript");
5
+ exports.typescript = {
6
+ ...typescript_1.typescript,
7
+ files: [...typescript_1.typescript.files, '*.tsx'],
8
+ };
9
+ //# sourceMappingURL=typescript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../../src/react/overrides/typescript.ts"],"names":[],"mappings":";;;AAEA,gEAAqE;AAExD,QAAA,UAAU,GAA0B;IAC/C,GAAG,uBAAI;IACP,KAAK,EAAE,CAAC,GAAG,uBAAI,CAAC,KAAK,EAAE,OAAO,CAAC;CAChC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const common: Linter.RulesRecord;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.common = void 0;
4
+ exports.common = {
5
+ 'react/function-component-definition': [
6
+ 'error',
7
+ {
8
+ namedComponents: ['arrow-function'],
9
+ unnamedComponents: 'function-expression',
10
+ },
11
+ ],
12
+ 'react/prop-types': 'off',
13
+ 'react/react-in-jsx-scope': 'off',
14
+ 'react/require-default-props': 'off',
15
+ };
16
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/react/rules/common.ts"],"names":[],"mappings":";;;AAEa,QAAA,MAAM,GAAuB;IACxC,qCAAqC,EAAE;QACrC,OAAO;QACP;YACE,eAAe,EAAE,CAAC,gBAAgB,CAAC;YACnC,iBAAiB,EAAE,qBAAqB;SACzC;KACF;IACD,kBAAkB,EAAE,KAAK;IACzB,0BAA0B,EAAE,KAAK;IACjC,6BAA6B,EAAE,KAAK;CACrC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const hooks: Linter.RulesRecord;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hooks = void 0;
4
+ exports.hooks = {
5
+ 'react-hooks/exhaustive-deps': 'warn',
6
+ };
7
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/react/rules/hooks.ts"],"names":[],"mappings":";;;AAEa,QAAA,KAAK,GAAuB;IACvC,6BAA6B,EAAE,MAAM;CACtC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const imports: Linter.RulesRecord;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.imports = void 0;
4
+ const utils_1 = require("../../utils");
5
+ exports.imports = {
6
+ ...(0, utils_1.getImportExtensionsRule)('.tsx'),
7
+ ...(0, utils_1.getExtraneousDependenciesRule)('/stories/**/*'),
8
+ };
9
+ //# sourceMappingURL=imports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imports.js","sourceRoot":"","sources":["../../../src/react/rules/imports.ts"],"names":[],"mappings":";;;AAEA,uCAGqB;AAER,QAAA,OAAO,GAAuB;IACzC,GAAG,IAAA,+BAAuB,EAAC,MAAM,CAAC;IAClC,GAAG,IAAA,qCAA6B,EAAC,eAAe,CAAC;CAClD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const rules: {
2
+ [x: string]: import("eslint").Linter.RuleEntry<any[]>;
3
+ };
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rules = void 0;
4
+ const common_1 = require("./common");
5
+ const hooks_1 = require("./hooks");
6
+ const imports_1 = require("./imports");
7
+ const jsx_1 = require("./jsx");
8
+ exports.rules = {
9
+ ...common_1.common,
10
+ ...hooks_1.hooks,
11
+ ...imports_1.imports,
12
+ ...jsx_1.jsx,
13
+ };
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/rules/index.ts"],"names":[],"mappings":";;;AAAA,qCAAkC;AAClC,mCAAgC;AAChC,uCAAoC;AACpC,+BAA4B;AAEf,QAAA,KAAK,GAAG;IACnB,GAAG,eAAM;IACT,GAAG,aAAK;IACR,GAAG,iBAAO;IACV,GAAG,SAAG;CACP,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const jsx: Linter.RulesRecord;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.jsx = void 0;
4
+ exports.jsx = {
5
+ 'react/jsx-filename-extension': [
6
+ 'error',
7
+ { allow: 'as-needed', extensions: ['.tsx'] },
8
+ ],
9
+ 'react/jsx-no-leaked-render': ['error', { validStrategies: ['ternary'] }],
10
+ 'react/jsx-sort-props': [
11
+ 'error',
12
+ {
13
+ reservedFirst: true,
14
+ },
15
+ ],
16
+ 'react/jsx-uses-react': 'off',
17
+ };
18
+ //# sourceMappingURL=jsx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx.js","sourceRoot":"","sources":["../../../src/react/rules/jsx.ts"],"names":[],"mappings":";;;AAEa,QAAA,GAAG,GAAuB;IACrC,8BAA8B,EAAE;QAC9B,OAAO;QACP,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE;KAC7C;IACD,4BAA4B,EAAE,CAAC,OAAO,EAAE,EAAE,eAAe,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;IACzE,sBAAsB,EAAE;QACtB,OAAO;QACP;YACE,aAAa,EAAE,IAAI;SACpB;KACF;IACD,sBAAsB,EAAE,KAAK;CAC9B,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { Linter } from 'eslint';
2
+ declare const _default: {
3
+ extends: string[];
4
+ env: {
5
+ browser: true;
6
+ };
7
+ plugins: string[];
8
+ parserOptions: {
9
+ ecmaFeatures: {
10
+ jsx: true;
11
+ };
12
+ jsxPragma: null;
13
+ };
14
+ rules: {
15
+ [x: string]: Linter.RuleEntry<any[]>;
16
+ };
17
+ overrides: Linter.ConfigOverride<Linter.RulesRecord>[];
18
+ settings: {
19
+ 'import/extensions': string[];
20
+ react: {
21
+ version: string;
22
+ };
23
+ };
24
+ };
25
+ export = _default;
package/dist/react.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ const config_1 = require("./react/config");
3
+ module.exports = {
4
+ ...config_1.config,
5
+ extends: ['airbnb', './base', ...config_1.config.extends],
6
+ };
7
+ //# sourceMappingURL=react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":";AAEA,2CAAwC;AAExC,iBAAS;IACP,GAAG,eAAM;IACT,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,eAAM,CAAC,OAAO,CAAC;CACzB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const getExtraneousDependenciesRule: (...patterns: string[]) => Linter.RulesRecord;
3
+ export declare const getImportExtensionsRule: (...extensions: string[]) => Linter.RulesRecord;
package/dist/utils.js ADDED
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getImportExtensionsRule = exports.getExtraneousDependenciesRule = void 0;
4
+ const constants_1 = require("./constants");
5
+ const getImportExtensionsRecord = (extensions) => {
6
+ const record = {};
7
+ for (const extension of extensions) {
8
+ record[extension.replace('.', '')] = 'never';
9
+ }
10
+ return record;
11
+ };
12
+ const getExtraneousDependenciesRule = (...patterns) => ({
13
+ 'import/no-extraneous-dependencies': [
14
+ 'error',
15
+ { devDependencies: [...constants_1.extraneousDependenciesPatterns, ...patterns] },
16
+ ],
17
+ });
18
+ exports.getExtraneousDependenciesRule = getExtraneousDependenciesRule;
19
+ const getImportExtensionsRule = (...extensions) => ({
20
+ 'import/extensions': [
21
+ 'error',
22
+ 'ignorePackages',
23
+ getImportExtensionsRecord([...constants_1.importExtensions, ...extensions]),
24
+ ],
25
+ });
26
+ exports.getImportExtensionsRule = getImportExtensionsRule;
27
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAEA,2CAA+E;AAE/E,MAAM,yBAAyB,GAAG,CAAC,UAAoB,EAAE,EAAE;IACzD,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QAClC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC;KAC9C;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEK,MAAM,6BAA6B,GAAG,CAC3C,GAAG,QAAkB,EACD,EAAE,CAAC,CAAC;IACxB,mCAAmC,EAAE;QACnC,OAAO;QACP,EAAE,eAAe,EAAE,CAAC,GAAG,0CAA8B,EAAE,GAAG,QAAQ,CAAC,EAAE;KACtE;CACF,CAAC,CAAC;AAPU,QAAA,6BAA6B,iCAOvC;AAEI,MAAM,uBAAuB,GAAG,CACrC,GAAG,UAAoB,EACH,EAAE,CAAC,CAAC;IACxB,mBAAmB,EAAE;QACnB,OAAO;QACP,gBAAgB;QAChB,yBAAyB,CAAC,CAAC,GAAG,4BAAgB,EAAE,GAAG,UAAU,CAAC,CAAC;KAChE;CACF,CAAC,CAAC;AARU,QAAA,uBAAuB,2BAQjC"}
package/index.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist');
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@apitree.cz/eslint-config",
3
+ "version": "0.1.0-next.05dd9cd",
4
+ "description": "ESLint configuration for ApiTree projects.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/ApiTreeCZ/toolbox",
8
+ "directory": "packages/eslint-config"
9
+ },
10
+ "sideEffects": false,
11
+ "type": "commonjs",
12
+ "main": "index.js",
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "dependencies": {
17
+ "@next/eslint-plugin-next": "^14.0.0",
18
+ "@typescript-eslint/eslint-plugin": "^6.9.0",
19
+ "@typescript-eslint/parser": "^6.9.0",
20
+ "eslint-config-airbnb": "^19.0.4",
21
+ "eslint-config-prettier": "^9.0.0",
22
+ "eslint-config-turbo": "^1.10.16",
23
+ "eslint-import-resolver-typescript": "^3.6.1",
24
+ "eslint-plugin-import": "^2.29.0",
25
+ "eslint-plugin-jest-dom": "^5.1.0",
26
+ "eslint-plugin-jsx-a11y": "^6.7.1",
27
+ "eslint-plugin-prettier": "^5.0.1",
28
+ "eslint-plugin-react": "^7.33.2",
29
+ "eslint-plugin-react-hooks": "^4.6.0",
30
+ "eslint-plugin-storybook": "^0.6.15",
31
+ "eslint-plugin-testing-library": "^6.1.0",
32
+ "eslint-plugin-unicorn": "^48.0.1",
33
+ "eslint-plugin-unused-imports": "^3.0.0",
34
+ "eslint-plugin-vitest": "^0.3.8"
35
+ },
36
+ "devDependencies": {
37
+ "@types/eslint": "^8.44.6",
38
+ "eslint": "^8.52.0",
39
+ "prettier": "^3.0.3",
40
+ "react": "^18.2.0",
41
+ "typescript": "^5.2.2",
42
+ "vitest": "^0.34.6"
43
+ },
44
+ "peerDependencies": {
45
+ "eslint": "^8.52.0",
46
+ "react": "^18.2.0"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "react": {
50
+ "optional": true
51
+ }
52
+ },
53
+ "scripts": {
54
+ "build": "tsc --build tsconfig.build.json",
55
+ "cleanup": "rimraf .eslintcache .turbo tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo dist node_modules",
56
+ "fix": "run-p ts format:fix lint:fix",
57
+ "format": "prettier --check \"./**/*.{json,md}\"",
58
+ "format:fix": "pnpm run format --write",
59
+ "lint": "eslint --cache --ext js,ts .",
60
+ "lint:fix": "pnpm run lint --fix",
61
+ "qa": "run-p ts format lint",
62
+ "ts": "tsc --build tsconfig.json"
63
+ }
64
+ }