@oriflame/config-eslint 4.1.12 → 4.1.16-alpha.115

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 (119) hide show
  1. package/LICENSE +1 -1
  2. package/dts/index.d.ts +10 -0
  3. package/lib/index.js +45 -40
  4. package/lib/index.js.map +1 -0
  5. package/package.json +37 -30
  6. package/src/index.ts +21 -27
  7. package/CHANGELOG.md +0 -3533
  8. package/lib/index.d.ts +0 -10
  9. package/lib/index.d.ts.map +0 -1
  10. package/lib/presets/SECRET_CONFIG_DO_NOT_USE_THIS.d.ts +0 -4
  11. package/lib/presets/SECRET_CONFIG_DO_NOT_USE_THIS.d.ts.map +0 -1
  12. package/lib/presets/SECRET_CONFIG_DO_NOT_USE_THIS.js +0 -32
  13. package/lib/presets/base.d.ts +0 -4
  14. package/lib/presets/base.d.ts.map +0 -1
  15. package/lib/presets/base.js +0 -120
  16. package/lib/presets/future.d.ts +0 -4
  17. package/lib/presets/future.d.ts.map +0 -1
  18. package/lib/presets/future.js +0 -13
  19. package/lib/presets/nextjs.d.ts +0 -4
  20. package/lib/presets/nextjs.d.ts.map +0 -1
  21. package/lib/presets/nextjs.js +0 -13
  22. package/lib/presets/node.d.ts +0 -4
  23. package/lib/presets/node.d.ts.map +0 -1
  24. package/lib/presets/node.js +0 -26
  25. package/lib/presets/prettier.d.ts +0 -4
  26. package/lib/presets/prettier.d.ts.map +0 -1
  27. package/lib/presets/prettier.js +0 -13
  28. package/lib/presets/typescript.d.ts +0 -4
  29. package/lib/presets/typescript.d.ts.map +0 -1
  30. package/lib/presets/typescript.js +0 -40
  31. package/lib/resolvers/graphql.d.ts +0 -6
  32. package/lib/resolvers/graphql.d.ts.map +0 -1
  33. package/lib/resolvers/graphql.js +0 -12
  34. package/lib/rules/a11y.d.ts +0 -4
  35. package/lib/rules/a11y.d.ts.map +0 -1
  36. package/lib/rules/a11y.js +0 -45
  37. package/lib/rules/eslint-comments.d.ts +0 -4
  38. package/lib/rules/eslint-comments.d.ts.map +0 -1
  39. package/lib/rules/eslint-comments.js +0 -14
  40. package/lib/rules/eslint.d.ts +0 -4
  41. package/lib/rules/eslint.d.ts.map +0 -1
  42. package/lib/rules/eslint.js +0 -385
  43. package/lib/rules/import.d.ts +0 -4
  44. package/lib/rules/import.d.ts.map +0 -1
  45. package/lib/rules/import.js +0 -76
  46. package/lib/rules/jest.d.ts +0 -4
  47. package/lib/rules/jest.d.ts.map +0 -1
  48. package/lib/rules/jest.js +0 -59
  49. package/lib/rules/nextjs.d.ts +0 -4
  50. package/lib/rules/nextjs.d.ts.map +0 -1
  51. package/lib/rules/nextjs.js +0 -17
  52. package/lib/rules/node.d.ts +0 -4
  53. package/lib/rules/node.d.ts.map +0 -1
  54. package/lib/rules/node.js +0 -45
  55. package/lib/rules/prettier.d.ts +0 -4
  56. package/lib/rules/prettier.d.ts.map +0 -1
  57. package/lib/rules/prettier.js +0 -6
  58. package/lib/rules/promise.d.ts +0 -4
  59. package/lib/rules/promise.d.ts.map +0 -1
  60. package/lib/rules/promise.js +0 -24
  61. package/lib/rules/react-hooks.d.ts +0 -4
  62. package/lib/rules/react-hooks.d.ts.map +0 -1
  63. package/lib/rules/react-hooks.js +0 -7
  64. package/lib/rules/react.d.ts +0 -4
  65. package/lib/rules/react.d.ts.map +0 -1
  66. package/lib/rules/react.js +0 -143
  67. package/lib/rules/testing-library.d.ts +0 -4
  68. package/lib/rules/testing-library.d.ts.map +0 -1
  69. package/lib/rules/testing-library.js +0 -31
  70. package/lib/rules/typescript.d.ts +0 -4
  71. package/lib/rules/typescript.d.ts.map +0 -1
  72. package/lib/rules/typescript.js +0 -369
  73. package/lib/rules/unicorn.d.ts +0 -4
  74. package/lib/rules/unicorn.d.ts.map +0 -1
  75. package/lib/rules/unicorn.js +0 -105
  76. package/src/presets/SECRET_CONFIG_DO_NOT_USE_THIS.ts +0 -34
  77. package/src/presets/base.ts +0 -143
  78. package/src/presets/future.ts +0 -13
  79. package/src/presets/nextjs.ts +0 -13
  80. package/src/presets/node.ts +0 -27
  81. package/src/presets/prettier.ts +0 -13
  82. package/src/presets/typescript.ts +0 -45
  83. package/src/resolvers/graphql.ts +0 -11
  84. package/src/rules/a11y.ts +0 -47
  85. package/src/rules/eslint-comments.ts +0 -16
  86. package/src/rules/eslint.ts +0 -384
  87. package/src/rules/import.ts +0 -79
  88. package/src/rules/jest.ts +0 -64
  89. package/src/rules/nextjs.ts +0 -19
  90. package/src/rules/node.ts +0 -47
  91. package/src/rules/prettier.ts +0 -8
  92. package/src/rules/promise.ts +0 -26
  93. package/src/rules/react-hooks.ts +0 -9
  94. package/src/rules/react.ts +0 -145
  95. package/src/rules/testing-library.ts +0 -33
  96. package/src/rules/typescript.ts +0 -377
  97. package/src/rules/unicorn.ts +0 -108
  98. package/test/index.test.ts +0 -81
  99. package/test/lint-files/combo.ts +0 -10
  100. package/test/lint-files/errors/combo.ts +0 -3
  101. package/test/lint-files/errors/javascript.js +0 -2
  102. package/test/lint-files/errors/next.js +0 -11
  103. package/test/lint-files/errors/node.js +0 -3
  104. package/test/lint-files/errors/prettier.js +0 -5
  105. package/test/lint-files/errors/test.js +0 -3
  106. package/test/lint-files/errors/typescript.ts +0 -3
  107. package/test/lint-files/javascript.js +0 -1
  108. package/test/lint-files/next.js +0 -5
  109. package/test/lint-files/node.js +0 -2
  110. package/test/lint-files/prettier.js +0 -1
  111. package/test/lint-files/test.js +0 -5
  112. package/test/lint-files/typescript.ts +0 -20
  113. package/test/tsconfig.json +0 -19
  114. package/test/utils/getErrors.ts +0 -16
  115. package/tools/check-rules/allRules.ts +0 -99
  116. package/tools/check-rules/index.ts +0 -90
  117. package/tools/check-rules/tsconfig.json +0 -17
  118. package/tsconfig.json +0 -22
  119. package/tsconfig.tsbuildinfo +0 -1
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 ORIFLAME SOFTWARE
3
+ Copyright (c) 2021 ORIFLAME SOFTWARE
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dts/index.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import type { ESLintConfig } from '@beemo/driver-eslint';
2
+ export interface ESLintOptions {
3
+ future?: boolean;
4
+ node?: boolean;
5
+ typescript?: boolean;
6
+ nextjs?: boolean;
7
+ prettier?: boolean;
8
+ }
9
+ export declare function getConfig({ future, node, typescript, nextjs, prettier, }: ESLintOptions): ESLintConfig;
10
+ //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -1,41 +1,46 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getIgnoreList = exports.getExtendsList = void 0;
4
- const core_1 = require("@beemo/core");
5
- const lumos_common_1 = require("@oriflame/lumos-common");
6
- function fromHere(filePath) {
7
- return `./${new core_1.Path(process.cwd())
8
- .relativeTo(new core_1.Path(__dirname, '../lib', filePath).resolve())
9
- .toString()}`;
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ });
6
+
7
+ const lumosCommon = require('@oriflame/lumos-common');
8
+
9
+ function getConfig({
10
+ future = false,
11
+ node = false,
12
+ typescript = false,
13
+ nextjs = false,
14
+ prettier = false
15
+ }) {
16
+ const presets = ['oriflame'];
17
+
18
+ if (future) {
19
+ presets.push('oriflame/future');
20
+ }
21
+
22
+ if (node) {
23
+ presets.push('oriflame/node');
24
+ }
25
+
26
+ if (typescript) {
27
+ presets.push('oriflame/typescript');
28
+ }
29
+
30
+ if (nextjs) {
31
+ presets.push('oriflame/nextjs');
32
+ }
33
+
34
+ if (prettier) {
35
+ presets.push('oriflame/prettier');
36
+ }
37
+
38
+ return {
39
+ root: true,
40
+ extends: presets,
41
+ ignore: [...lumosCommon.IGNORE_PATHS, 'jest.config.js', 'babel.config.js', 'webpack.config.js', 'build*/', '\\.eslintrc.js']
42
+ };
10
43
  }
11
- function getExtendsList({ future = false, node = false, typescript = false, nextjs = false, prettier = false, }) {
12
- const paths = [fromHere('./presets/base')];
13
- if (future) {
14
- paths.push(fromHere('./presets/future'));
15
- }
16
- if (node) {
17
- paths.push(fromHere('./presets/node'));
18
- }
19
- if (typescript) {
20
- paths.push(fromHere('./presets/typescript'));
21
- }
22
- if (nextjs) {
23
- paths.push(fromHere('./presets/nextjs'));
24
- }
25
- if (prettier) {
26
- paths.push(fromHere('./presets/prettier'));
27
- }
28
- return paths;
29
- }
30
- exports.getExtendsList = getExtendsList;
31
- function getIgnoreList() {
32
- return [
33
- ...lumos_common_1.IGNORE_PATHS,
34
- 'jest.config.js',
35
- 'babel.config.js',
36
- 'webpack.config.js',
37
- 'build*/',
38
- '\\.eslintrc.js',
39
- ];
40
- }
41
- exports.getIgnoreList = getIgnoreList;
44
+
45
+ exports.getConfig = getConfig;
46
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":null,"names":["getConfig","future","node","typescript","nextjs","prettier","presets","push","root","extends","ignore","IGNORE_PATHS"],"mappings":";;;;;;AAWO,SAASA,SAAT,CAAmB;AACxBC,EAAAA,MAAM,GAAG,KADe;AAExBC,EAAAA,IAAI,GAAG,KAFiB;AAGxBC,EAAAA,UAAU,GAAG,KAHW;AAIxBC,EAAAA,MAAM,GAAG,KAJe;AAKxBC,EAAAA,QAAQ,GAAG;AALa,CAAnB,EAMyB;AAC9B,QAAMC,OAAO,GAAG,CAAC,UAAD,CAAhB;;AAEA,MAAIL,MAAJ,EAAY;AACVK,IAAAA,OAAO,CAACC,IAAR,CAAa,iBAAb;AACD;;AAED,MAAIL,IAAJ,EAAU;AACRI,IAAAA,OAAO,CAACC,IAAR,CAAa,eAAb;AACD;;AAED,MAAIJ,UAAJ,EAAgB;AACdG,IAAAA,OAAO,CAACC,IAAR,CAAa,qBAAb;AACD;;AAED,MAAIH,MAAJ,EAAY;AACVE,IAAAA,OAAO,CAACC,IAAR,CAAa,iBAAb;AACD;;AAED,MAAIF,QAAJ,EAAc;AACZC,IAAAA,OAAO,CAACC,IAAR,CAAa,mBAAb;AACD;;AAED,SAAO;AACLC,IAAAA,IAAI,EAAE,IADD;AAELC,IAAAA,OAAO,EAAEH,OAFJ;AAGLI,IAAAA,MAAM,EAAE,CACN,GAAGC,wBADG,EAEN,gBAFM,EAGN,iBAHM,EAIN,mBAJM,EAKN,SALM,EAMN,gBANM;AAHH,GAAP;AAYD;;;;"}
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@oriflame/config-eslint",
3
- "version": "4.1.12",
3
+ "version": "4.1.16-alpha.115+17dbeb25",
4
4
  "description": "Reusable ESLint config.",
5
5
  "keywords": [
6
6
  "lumos",
7
7
  "config",
8
8
  "eslint"
9
9
  ],
10
- "main": "lib/index.js",
10
+ "main": "./lib/index.js",
11
+ "types": "./dts/index.d.ts",
11
12
  "repository": {
12
13
  "type": "git",
13
14
  "url": "git@github.com:Oriflame/lumos.git"
@@ -17,39 +18,45 @@
17
18
  "publishConfig": {
18
19
  "access": "public"
19
20
  },
20
- "scripts": {
21
- "check-rules": "ts-node tools/check-rules/index.ts"
22
- },
23
21
  "engines": {
24
- "node": ">=10.16.0"
22
+ "node": ">=12.17.0",
23
+ "npm": ">=6.13.0"
25
24
  },
25
+ "files": [
26
+ "dts/**/*.d.ts",
27
+ "lib/**/*.{js,map,d.ts}",
28
+ "lib/**/*.{js,map}",
29
+ "src/**/*.{ts,tsx,json}"
30
+ ],
26
31
  "dependencies": {
27
- "@beemo/core": "^1.1.8",
28
- "@beemo/driver-eslint": "^1.2.3",
29
- "@next/eslint-plugin-next": "^12.0.1",
30
- "@oriflame/lumos-common": "^4.1.12",
31
- "@typescript-eslint/eslint-plugin": "^5.2.0",
32
- "@typescript-eslint/parser": "^5.2.0",
33
- "babel-eslint": "^10.1.0",
34
- "confusing-browser-globals": "^1.0.10",
35
- "eslint": "^7.32.0",
36
- "eslint-config-prettier": "^8.3.0",
37
- "eslint-import-resolver-typescript": "^2.5.0",
38
- "eslint-plugin-eslint-comments": "^3.2.0",
39
- "eslint-plugin-import": "^2.25.2",
40
- "eslint-plugin-jest": "^25.2.2",
41
- "eslint-plugin-jsx-a11y": "^6.4.1",
42
- "eslint-plugin-node": "^11.1.0",
43
- "eslint-plugin-prettier": "^4.0.0",
44
- "eslint-plugin-promise": "^5.1.1",
45
- "eslint-plugin-react": "^7.26.1",
46
- "eslint-plugin-react-hooks": "^4.2.0",
47
- "eslint-plugin-testing-library": "^5.0.0",
48
- "eslint-plugin-unicorn": "^37.0.1"
32
+ "@oriflame/lumos-common": "^4.1.16-alpha.115+17dbeb25",
33
+ "eslint-config-oriflame": "^4.1.16-alpha.115+17dbeb25"
49
34
  },
50
35
  "devDependencies": {
51
- "@types/confusing-browser-globals": "^1.0.0",
36
+ "@beemo/core": "^2.1.2",
37
+ "@beemo/driver-eslint": "^2.0.3",
38
+ "@types/node": "^16.11.13",
39
+ "eslint": "^8.4.1",
52
40
  "ts-node": "^10.4.0"
53
41
  },
54
- "gitHead": "08a72ceb0f93b5aef8fa73c6587fb48c4906e323"
42
+ "peerDependencies": {
43
+ "@beemo/core": "^2.1.2",
44
+ "@beemo/driver-eslint": "^2.0.3",
45
+ "eslint": "^8.4.1",
46
+ "prettier": "^2.5.1",
47
+ "typescript": ">=4.5"
48
+ },
49
+ "peerDependenciesMeta": {
50
+ "prettier": {
51
+ "optional": true
52
+ },
53
+ "typescript": {
54
+ "optional": true
55
+ }
56
+ },
57
+ "packemon": {
58
+ "format": "lib",
59
+ "platform": "node"
60
+ },
61
+ "gitHead": "17dbeb254f9d19b8418ab9464b248247573d1ce2"
55
62
  }
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Path } from '@beemo/core';
1
+ import type { ESLintConfig } from '@beemo/driver-eslint';
2
2
  import { IGNORE_PATHS } from '@oriflame/lumos-common';
3
3
 
4
4
  export interface ESLintOptions {
@@ -9,51 +9,45 @@ export interface ESLintOptions {
9
9
  prettier?: boolean;
10
10
  }
11
11
 
12
- function fromHere(filePath: string): string {
13
- return `./${new Path(process.cwd())
14
- .relativeTo(new Path(__dirname, '../lib', filePath).resolve())
15
- .toString()}`;
16
- }
17
-
18
- export function getExtendsList({
12
+ export function getConfig({
19
13
  future = false,
20
14
  node = false,
21
15
  typescript = false,
22
16
  nextjs = false,
23
17
  prettier = false,
24
- }: ESLintOptions): string[] {
25
- const paths = [fromHere('./presets/base')];
18
+ }: ESLintOptions): ESLintConfig {
19
+ const presets = ['oriflame'];
26
20
 
27
21
  if (future) {
28
- paths.push(fromHere('./presets/future'));
22
+ presets.push('oriflame/future');
29
23
  }
30
24
 
31
25
  if (node) {
32
- paths.push(fromHere('./presets/node'));
26
+ presets.push('oriflame/node');
33
27
  }
34
28
 
35
29
  if (typescript) {
36
- paths.push(fromHere('./presets/typescript'));
30
+ presets.push('oriflame/typescript');
37
31
  }
38
32
 
39
33
  if (nextjs) {
40
- paths.push(fromHere('./presets/nextjs'));
34
+ presets.push('oriflame/nextjs');
41
35
  }
42
36
 
43
37
  if (prettier) {
44
- paths.push(fromHere('./presets/prettier'));
38
+ presets.push('oriflame/prettier');
45
39
  }
46
40
 
47
- return paths;
48
- }
49
-
50
- export function getIgnoreList(): string[] {
51
- return [
52
- ...IGNORE_PATHS,
53
- 'jest.config.js',
54
- 'babel.config.js',
55
- 'webpack.config.js',
56
- 'build*/',
57
- '\\.eslintrc.js',
58
- ];
41
+ return {
42
+ root: true,
43
+ extends: presets,
44
+ ignore: [
45
+ ...IGNORE_PATHS,
46
+ 'jest.config.js',
47
+ 'babel.config.js',
48
+ 'webpack.config.js',
49
+ 'build*/',
50
+ '\\.eslintrc.js',
51
+ ],
52
+ };
59
53
  }