eslint-config-airbnb-extended 0.3.0 → 0.4.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.
Files changed (64) hide show
  1. package/README.md +10 -0
  2. package/dist/@types/index.d.ts +22 -0
  3. package/dist/configs/base/index.js +24 -0
  4. package/dist/{base → configs/base}/recommended.js +4 -3
  5. package/dist/configs/index.js +34 -0
  6. package/dist/{react → configs/react}/index.js +5 -4
  7. package/dist/{react → configs/react}/recommended.js +5 -6
  8. package/dist/configs/typescript/index.js +14 -0
  9. package/dist/{typescript → configs/typescript}/recommended.js +6 -5
  10. package/dist/helpers/getDevDepsList.js +1 -2
  11. package/dist/index.js +11 -37
  12. package/dist/plugins/index.js +21 -0
  13. package/dist/plugins/nextPlugin.js +12 -0
  14. package/dist/plugins/reactA11yPlugin.js +12 -0
  15. package/dist/plugins/reactHooksPlugin.js +51 -0
  16. package/dist/plugins/reactPlugin.js +13 -0
  17. package/dist/plugins/typescriptEslintPlugin.js +16 -0
  18. package/dist/rules/best-practices.js +2 -1
  19. package/dist/rules/errors.js +2 -1
  20. package/dist/rules/es6.js +2 -1
  21. package/dist/rules/imports.js +8 -13
  22. package/dist/rules/importsStrict.js +3 -16
  23. package/dist/rules/index.js +21 -0
  24. package/dist/rules/next.js +2 -4
  25. package/dist/rules/node.js +2 -1
  26. package/dist/rules/react-a11y.js +2 -7
  27. package/dist/rules/react-hooks.js +2 -38
  28. package/dist/rules/react.js +2 -5
  29. package/dist/rules/strict.js +2 -1
  30. package/dist/rules/style.js +2 -1
  31. package/dist/rules/typescript/typescriptBase.js +3 -2
  32. package/dist/rules/typescript/typescriptEslint.js +11 -17
  33. package/dist/rules/typescript/typescriptImports.js +8 -4
  34. package/dist/rules/variables.js +2 -1
  35. package/package.json +3 -3
  36. package/dist/base/index.d.ts +0 -990
  37. package/dist/base/index.js +0 -23
  38. package/dist/base/recommended.d.ts +0 -990
  39. package/dist/helpers/getDevDepsList.d.ts +0 -3
  40. package/dist/index.d.ts +0 -17982
  41. package/dist/react/index.d.ts +0 -1793
  42. package/dist/react/recommended.d.ts +0 -2786
  43. package/dist/rules/best-practices.d.ts +0 -177
  44. package/dist/rules/errors.d.ts +0 -69
  45. package/dist/rules/es6.d.ts +0 -146
  46. package/dist/rules/imports.d.ts +0 -151
  47. package/dist/rules/importsStrict.d.ts +0 -43
  48. package/dist/rules/next.d.ts +0 -8
  49. package/dist/rules/node.d.ts +0 -90
  50. package/dist/rules/react-a11y.d.ts +0 -117
  51. package/dist/rules/react-hooks.d.ts +0 -19
  52. package/dist/rules/react.d.ts +0 -1659
  53. package/dist/rules/strict.d.ts +0 -7
  54. package/dist/rules/style.d.ts +0 -320
  55. package/dist/rules/typescript/typescriptBase.d.ts +0 -23
  56. package/dist/rules/typescript/typescriptEslint.d.ts +0 -3
  57. package/dist/rules/typescript/typescriptImports.d.ts +0 -37
  58. package/dist/rules/typescript.d.ts +0 -47
  59. package/dist/rules/typescript.js +0 -9
  60. package/dist/rules/variables.d.ts +0 -35
  61. package/dist/typescript/index.d.ts +0 -58
  62. package/dist/typescript/index.js +0 -11
  63. package/dist/typescript/recommended.d.ts +0 -112
  64. package/dist/utils/index.d.ts +0 -13
@@ -1,44 +1,7 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
- const EsLintPluginReactHooks = __importStar(require("eslint-plugin-react-hooks"));
37
- exports.default = {
3
+ const reactHooksRules = {
38
4
  name: 'airbnb/config/react-hooks',
39
- plugins: {
40
- 'react-hooks': EsLintPluginReactHooks,
41
- },
42
5
  languageOptions: {
43
6
  parserOptions: {
44
7
  ecmaFeatures: {
@@ -55,3 +18,4 @@ exports.default = {
55
18
  'react-hooks/exhaustive-deps': 'error',
56
19
  },
57
20
  };
21
+ exports.default = reactHooksRules;
@@ -3,15 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const eslint_plugin_react_1 = __importDefault(require("eslint-plugin-react"));
7
6
  const globals_1 = __importDefault(require("globals"));
8
7
  const style_1 = __importDefault(require("../rules/style"));
9
8
  const dangleRules = style_1.default.rules['no-underscore-dangle'];
10
- exports.default = {
9
+ const reactRules = {
11
10
  name: 'airbnb/config/react',
12
- plugins: {
13
- react: eslint_plugin_react_1.default,
14
- },
15
11
  languageOptions: {
16
12
  parserOptions: {
17
13
  ecmaFeatures: {
@@ -576,3 +572,4 @@ exports.default = {
576
572
  'react/jsx-props-no-spread-multi': 'off',
577
573
  },
578
574
  };
575
+ exports.default = reactRules;
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
3
+ const strictRules = {
4
4
  name: 'airbnb/config/strict',
5
5
  rules: {
6
6
  // babel inserts `'use strict';` for us
7
7
  strict: ['error', 'never'],
8
8
  },
9
9
  };
10
+ exports.default = strictRules;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
3
+ const styleRules = {
4
4
  name: 'airbnb/config/style',
5
5
  rules: {
6
6
  // enforce line breaks after opening and before closing array brackets
@@ -528,3 +528,4 @@ exports.default = {
528
528
  'wrap-regex': 'off',
529
529
  },
530
530
  };
531
+ exports.default = styleRules;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- name: 'airbnb/config/typescript',
3
+ const typescriptBaseRules = {
4
+ name: 'airbnb/config/typescript/base',
5
5
  rules: {
6
6
  // The following rules are enabled in Airbnb config, but are already checked (more thoroughly) by the TypeScript compiler
7
7
  // Rules are inspired by: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended-raw.ts
@@ -24,3 +24,4 @@ exports.default = {
24
24
  'valid-typeof': 'off',
25
25
  },
26
26
  };
27
+ exports.default = typescriptBaseRules;
@@ -3,23 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const typescript_eslint_1 = require("typescript-eslint");
7
6
  const best_practices_1 = __importDefault(require("../../rules/best-practices"));
8
7
  const errors_1 = __importDefault(require("../../rules/errors"));
9
8
  const es6_1 = __importDefault(require("../../rules/es6"));
10
9
  const style_1 = __importDefault(require("../../rules/style"));
11
10
  const variables_1 = __importDefault(require("../../rules/variables"));
12
- exports.default = {
13
- name: 'airbnb/config/typescript/eslint',
14
- plugins: {
15
- '@typescript-eslint': typescript_eslint_1.plugin,
16
- },
17
- languageOptions: {
18
- parser: typescript_eslint_1.parser,
19
- parserOptions: {
20
- projectService: true,
21
- },
22
- },
11
+ const typescriptEslintRules = {
12
+ name: 'airbnb/config/typescript/typescript-eslint',
23
13
  rules: {
24
14
  // Replace Airbnb 'brace-style' rule with '@typescript-eslint' version
25
15
  // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/brace-style.md
@@ -81,8 +71,8 @@ exports.default = {
81
71
  '@typescript-eslint/keyword-spacing': style_1.default.rules['keyword-spacing'],
82
72
  // Replace Airbnb 'lines-between-class-members' rule with '@typescript-eslint' version
83
73
  // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/lines-between-class-members.md
84
- 'lines-between-class-members': 'off',
85
- '@typescript-eslint/lines-between-class-members': style_1.default.rules['lines-between-class-members'],
74
+ // 'lines-between-class-members': 'off',
75
+ // '@typescript-eslint/lines-between-class-members': styleRules.rules['lines-between-class-members'],
86
76
  // Replace Airbnb 'no-array-constructor' rule with '@typescript-eslint' version
87
77
  // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md
88
78
  'no-array-constructor': 'off',
@@ -134,8 +124,8 @@ exports.default = {
134
124
  '@typescript-eslint/space-before-blocks': style_1.default.rules['space-before-blocks'],
135
125
  // Replace Airbnb 'no-throw-literal' rule with '@typescript-eslint' version
136
126
  // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md
137
- 'no-throw-literal': 'off',
138
- '@typescript-eslint/no-throw-literal': best_practices_1.default.rules['no-throw-literal'],
127
+ // 'no-throw-literal': 'off',
128
+ // '@typescript-eslint/no-throw-literal': bestPracticesRules.rules['no-throw-literal'],
139
129
  // Replace Airbnb 'no-unused-expressions' rule with '@typescript-eslint' version
140
130
  // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md
141
131
  'no-unused-expressions': 'off',
@@ -171,7 +161,10 @@ exports.default = {
171
161
  // Replace Airbnb 'no-return-await' rule with '@typescript-eslint' version
172
162
  // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md
173
163
  'no-return-await': 'off',
174
- '@typescript-eslint/return-await': [best_practices_1.default.rules['no-return-await'], 'in-try-catch'],
164
+ '@typescript-eslint/return-await': [
165
+ best_practices_1.default.rules['no-return-await'],
166
+ 'in-try-catch',
167
+ ],
175
168
  // Replace Airbnb 'space-infix-ops' rule with '@typescript-eslint' version
176
169
  // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-infix-ops.md
177
170
  'space-infix-ops': 'off',
@@ -182,3 +175,4 @@ exports.default = {
182
175
  '@typescript-eslint/object-curly-spacing': style_1.default.rules['object-curly-spacing'],
183
176
  },
184
177
  };
178
+ exports.default = typescriptEslintRules;
@@ -1,12 +1,15 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("../../utils");
4
- const getDevDepsList_1 = require("../../helpers/getDevDepsList");
5
6
  const eslint_import_resolver_typescript_1 = require("eslint-import-resolver-typescript");
7
+ const getDevDepsList_1 = __importDefault(require("../../helpers/getDevDepsList"));
8
+ const utils_1 = require("../../utils");
6
9
  /**
7
10
  * @see https://github.com/un-ts/eslint-plugin-import-x/blob/master/src/config/typescript.ts
8
11
  */
9
- exports.default = {
12
+ const typescriptImportsRules = {
10
13
  name: 'airbnb/config/typescript/import-x',
11
14
  settings: {
12
15
  // Apply special parsing for TypeScript files
@@ -39,7 +42,7 @@ exports.default = {
39
42
  'import-x/no-extraneous-dependencies': [
40
43
  'error',
41
44
  {
42
- devDependencies: (0, getDevDepsList_1.getDevDepsList)(utils_1.tsExtensions.join(',')),
45
+ devDependencies: (0, getDevDepsList_1.default)([...utils_1.jsExtensions, ...utils_1.tsExtensions].map((ext) => ext.slice(1)).join(',')),
43
46
  optionalDependencies: false,
44
47
  peerDependencies: true,
45
48
  bundledDependencies: true,
@@ -52,3 +55,4 @@ exports.default = {
52
55
  'import-x/no-named-as-default-member': 'off',
53
56
  },
54
57
  };
58
+ exports.default = typescriptImportsRules;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const confusing_browser_globals_1 = __importDefault(require("confusing-browser-globals"));
7
- exports.default = {
7
+ const variablesRules = {
8
8
  name: 'airbnb/config/variables',
9
9
  rules: {
10
10
  // enforce or disallow variable initializations at definition
@@ -63,3 +63,4 @@ exports.default = {
63
63
  ],
64
64
  },
65
65
  };
66
+ exports.default = variablesRules;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-airbnb-extended",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Eslint Airbnb Config Extended",
5
5
  "keywords": [
6
6
  "eslint",
@@ -29,7 +29,7 @@
29
29
  "author": "Nisharg Shah <nishargshah3101@gmail.com>",
30
30
  "type": "commonjs",
31
31
  "main": "dist/index.js",
32
- "types": "dist/index.d.ts",
32
+ "types": "dist/@types/index.d.ts",
33
33
  "dependencies": {
34
34
  "confusing-browser-globals": "^1.0.11",
35
35
  "globals": "^16.0.0"
@@ -77,7 +77,7 @@
77
77
  }
78
78
  },
79
79
  "scripts": {
80
- "build": "tsc",
80
+ "build": "tsc -b",
81
81
  "postbuild": "tsc-alias",
82
82
  "typecheck": "tsc --noEmit"
83
83
  }