eslint-plugin-gb 2.0.0-alpha.6 → 9.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/configs/all.js ADDED
File without changes
@@ -0,0 +1,22 @@
1
+ import memberOrder from "../member-order.js";
2
+
3
+ export default [
4
+ {
5
+ name: "gb/base/rules",
6
+ rules: {
7
+ "@typescript-eslint/explicit-member-accessibility": "warn",
8
+ "@typescript-eslint/explicit-module-boundary-types": "warn",
9
+ "@typescript-eslint/no-unused-vars": "off",
10
+ "@typescript-eslint/member-ordering": [
11
+ "warn",
12
+ {
13
+ default: {
14
+ memberTypes: memberOrder,
15
+ order: "alphabetically",
16
+ },
17
+ },
18
+ ],
19
+ "@typescript-eslint/consistent-type-imports": "warn",
20
+ },
21
+ },
22
+ ];
@@ -0,0 +1,3 @@
1
+ import base from "./base.js";
2
+
3
+ export default [...base];
@@ -0,0 +1,104 @@
1
+ export default [
2
+ // Index signature
3
+ 'signature',
4
+ 'call-signature',
5
+ // Fields
6
+ 'public-static-field',
7
+ 'protected-static-field',
8
+ 'private-static-field',
9
+ '#private-static-field',
10
+ 'public-decorated-field',
11
+ 'protected-decorated-field',
12
+ 'private-decorated-field',
13
+ 'public-instance-field',
14
+ 'protected-instance-field',
15
+ 'private-instance-field',
16
+ '#private-instance-field',
17
+ 'public-abstract-field',
18
+ 'protected-abstract-field',
19
+ 'public-field',
20
+ 'protected-field',
21
+ 'private-field',
22
+ '#private-field',
23
+ 'static-field',
24
+ 'instance-field',
25
+ 'abstract-field',
26
+ 'decorated-field',
27
+ 'field',
28
+ // Static initialization
29
+ 'static-initialization',
30
+ // Constructors
31
+ 'public-constructor',
32
+ 'protected-constructor',
33
+ 'private-constructor',
34
+ 'constructor',
35
+ // Getters
36
+ 'public-static-get',
37
+ 'protected-static-get',
38
+ 'private-static-get',
39
+ '#private-static-get',
40
+ 'public-decorated-get',
41
+ 'protected-decorated-get',
42
+ 'private-decorated-get',
43
+ 'public-instance-get',
44
+ 'protected-instance-get',
45
+ 'private-instance-get',
46
+ '#private-instance-get',
47
+ 'public-abstract-get',
48
+ 'protected-abstract-get',
49
+ 'public-get',
50
+ 'protected-get',
51
+ 'private-get',
52
+ '#private-get',
53
+ 'static-get',
54
+ 'instance-get',
55
+ 'abstract-get',
56
+ 'decorated-get',
57
+ 'get',
58
+ // Setters
59
+ 'public-static-set',
60
+ 'protected-static-set',
61
+ 'private-static-set',
62
+ '#private-static-set',
63
+ 'public-decorated-set',
64
+ 'protected-decorated-set',
65
+ 'private-decorated-set',
66
+ 'public-instance-set',
67
+ 'protected-instance-set',
68
+ 'private-instance-set',
69
+ '#private-instance-set',
70
+ 'public-abstract-set',
71
+ 'protected-abstract-set',
72
+ 'public-set',
73
+ 'protected-set',
74
+ 'private-set',
75
+ '#private-set',
76
+ 'static-set',
77
+ 'instance-set',
78
+ 'abstract-set',
79
+ 'decorated-set',
80
+ 'set',
81
+ // Methods
82
+ 'public-static-method',
83
+ 'protected-static-method',
84
+ 'private-static-method',
85
+ '#private-static-method',
86
+ 'public-decorated-method',
87
+ 'protected-decorated-method',
88
+ 'private-decorated-method',
89
+ 'public-instance-method',
90
+ 'protected-instance-method',
91
+ 'private-instance-method',
92
+ '#private-instance-method',
93
+ 'public-abstract-method',
94
+ 'protected-abstract-method',
95
+ 'public-method',
96
+ 'protected-method',
97
+ 'private-method',
98
+ '#private-method',
99
+ 'static-method',
100
+ 'instance-method',
101
+ 'abstract-method',
102
+ 'decorated-method',
103
+ 'method',
104
+ ];
package/index.js ADDED
@@ -0,0 +1,46 @@
1
+ import fs from "fs";
2
+
3
+ import flatRecommended from "./configs/flat/recommended.js";
4
+ import flatBase from "./configs/flat/base.js";
5
+
6
+ const pkg = JSON.parse(
7
+ fs.readFileSync(new URL("./package.json", import.meta.url), "utf8")
8
+ );
9
+
10
+ const plugin = {
11
+ meta: {
12
+ name: pkg.name,
13
+ version: pkg.version,
14
+ },
15
+ configs: {
16
+ "flat/base": flatBase,
17
+ "flat/recommended": flatRecommended,
18
+ },
19
+ rules: {},
20
+ processors: {},
21
+ };
22
+
23
+ // Object.assign(plugin.configs, {
24
+ // recommended: [
25
+ // {
26
+ // plugins: {
27
+ // gb: plugin,
28
+ // },
29
+ // rules: {
30
+ // "example/dollar-sign": "error",
31
+ // },
32
+ // languageOptions: {
33
+ // globals: {
34
+ // myGlobal: "readonly",
35
+ // },
36
+ // parserOptions: {
37
+ // ecmaFeatures: {
38
+ // jsx: true,
39
+ // },
40
+ // },
41
+ // },
42
+ // },
43
+ // ],
44
+ // });
45
+
46
+ export default plugin;
package/package.json CHANGED
@@ -1,41 +1,30 @@
1
1
  {
2
2
  "name": "eslint-plugin-gb",
3
- "version": "2.0.0-alpha.6",
4
- "license": "MIT",
3
+ "version": "9.0.0-alpha.1",
4
+ "description": "Eslint rules I like",
5
+ "main": "index.js",
5
6
  "dependencies": {
6
- "@typescript-eslint/eslint-plugin": "^6.9.1",
7
- "tslib": "^2.3.0"
7
+ "globals": "^15.9.0"
8
8
  },
9
- "devDependencies": {
10
- "@nx/eslint-plugin": "17.1.3",
11
- "@nx/js": "17.1.3",
12
- "@nx/vite": "17.1.3",
13
- "@nx/workspace": "17.1.3",
14
- "@types/node": "18.7.1",
15
- "@typescript-eslint/parser": "6.9.1",
16
- "@vitest/coverage-c8": "~0.32.0",
17
- "@vitest/ui": "~0.32.0",
18
- "eslint": "~8.46.0",
19
- "eslint-config-prettier": "9.0.0",
20
- "nx": "17.1.3",
21
- "prettier": "^2.6.2",
22
- "typescript": "5.2.2",
23
- "vite": "~4.3.9",
24
- "vitest": "~0.32.0",
25
- "@nx/eslint": "17.1.3"
9
+ "peerDependencies": {
10
+ "eslint": "^9.9.0"
26
11
  },
27
- "type": "commonjs",
28
- "main": "./src/index.js",
29
- "typings": "./src/index.d.ts",
30
12
  "repository": {
31
13
  "type": "git",
32
- "url": "https://github.com/garyb432/eslint-plugin-gb.git"
14
+ "url": "git+https://github.com/GaryB432/eslint-plugin-gb.git"
33
15
  },
34
- "homepage": "https://github.com/GaryB432/eslint-plugin-gb/tree/master/packages/eslint-plugin-gb",
16
+ "type": "module",
35
17
  "keywords": [
36
18
  "eslint",
37
- "eslintplugin",
38
19
  "eslint-plugin",
39
- "typescript"
40
- ]
20
+ "eslintplugin"
21
+ ],
22
+ "license": "ISC",
23
+ "bugs": {
24
+ "url": "https://github.com/GaryB432/eslint-plugin-gb/issues"
25
+ },
26
+ "homepage": "https://github.com/GaryB432/eslint-plugin-gb#readme",
27
+ "publishConfig": {
28
+ "access": "public"
29
+ }
41
30
  }
package/README.md DELETED
@@ -1,45 +0,0 @@
1
- # eslint-plugin-gb
2
-
3
- ## Description
4
-
5
- My favorite eslint configurations
6
-
7
- ## Installation
8
-
9
- ```
10
- $ npm i --save-dev typescript
11
- $ npm i --save-dev eslint
12
- $ npm i --save-dev @typescript-eslint/parser
13
- $ npm i --save-dev @typescript-eslint/eslint-plugin
14
- $ npm i --save-dev eslint-plugin-gb
15
- ```
16
-
17
- ## Usage
18
-
19
- ```js
20
- // .eslintrc.js
21
-
22
- module.exports = {
23
- plugins: ['gb'],
24
- extends: ['plugin:gb/recommended'],
25
- };
26
- ```
27
-
28
- ## `recommended` config
29
-
30
- | Rule | Setting |
31
- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
32
- | [@typescript-eslint/consistent-type-imports](https://typescript-eslint.io/rules/consistent-type-imports) | warn |
33
- | [@typescript-eslint/explicit-member-accessibility](https://typescript-eslint.io/rules/explicit-member-accessibility/) | warn |
34
- | [@typescript-eslint/explicit-module-boundary-types](https://typescript-eslint.io/rules/explicit-module-boundary-types/) | warn |
35
- | [@typescript-eslint/member-ordering](https://typescript-eslint.io/rules/member-ordering/) | warn (with alphabetical ordering) |
36
- | [@typescript-eslint/no-unused-vars](https://typescript-eslint.io/rules/no-unused-vars/) | off |
37
-
38
- ## `recommended-with-type-checking` config
39
-
40
- all of the `recommended` rules and also the following.
41
-
42
- | Rule | Setting |
43
- | --------------------------------------------------------------------------------------------------- | ------- |
44
- | [@typescript-eslint/no-floating-promises](https://typescript-eslint.io/rules/no-floating-promises/) | warn |
45
- | [@typescript-eslint/unbound-method](https://typescript-eslint.io/rules/unbound-method/) | error |
package/src/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/src/index.js DELETED
@@ -1,81 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const member_order_1 = require("./member-order");
4
- module.exports = {
5
- configs: {
6
- base: {
7
- env: {
8
- node: true,
9
- es2021: true,
10
- },
11
- plugins: ['@typescript-eslint'],
12
- extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
13
- rules: {
14
- '@typescript-eslint/explicit-member-accessibility': 'warn',
15
- '@typescript-eslint/explicit-module-boundary-types': 'warn',
16
- '@typescript-eslint/no-unused-vars': 'off',
17
- '@typescript-eslint/member-ordering': [
18
- 'warn',
19
- {
20
- default: {
21
- memberTypes: member_order_1.default,
22
- order: 'alphabetically',
23
- },
24
- },
25
- ],
26
- '@typescript-eslint/consistent-type-imports': 'warn',
27
- },
28
- },
29
- recommended: {
30
- plugins: ['gb'],
31
- extends: ['plugin:gb/base'],
32
- },
33
- 'recommended-type-checked': {
34
- plugins: ['gb'],
35
- extends: ['plugin:gb/recommended'],
36
- rules: {
37
- '@typescript-eslint/unbound-method': ['error', { ignoreStatic: true }],
38
- '@typescript-eslint/no-floating-promises': 'warn',
39
- },
40
- },
41
- all: {
42
- env: {
43
- node: true,
44
- es2021: true,
45
- jest: true,
46
- },
47
- plugins: ['@typescript-eslint', 'jest'],
48
- extends: [
49
- 'eslint:recommended',
50
- 'plugin:@typescript-eslint/recommended',
51
- 'plugin:@typescript-eslint/recommended-type-checked',
52
- 'plugin:@typescript-eslint/stylistic-type-checked',
53
- 'plugin:prettier/recommended',
54
- ],
55
- overrides: [
56
- {
57
- files: ['**/*.spec.ts'],
58
- rules: {
59
- '@typescript-eslint/unbound-method': 'off',
60
- 'jest/unbound-method': 'error',
61
- },
62
- },
63
- ],
64
- rules: {
65
- 'prettier/prettier': 'warn',
66
- '@typescript-eslint/explicit-member-accessibility': 'warn',
67
- '@typescript-eslint/no-unused-vars': 'off',
68
- '@typescript-eslint/member-ordering': [
69
- 'warn',
70
- {
71
- default: {
72
- memberTypes: member_order_1.default,
73
- order: 'alphabetically',
74
- },
75
- },
76
- ],
77
- },
78
- },
79
- },
80
- };
81
- //# sourceMappingURL=index.js.map
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;AAAA,iDAAyC;AAEzC,MAAM,CAAC,OAAO,GAAG;IACf,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,GAAG,EAAE;gBACH,IAAI,EAAE,IAAI;gBACV,MAAM,EAAE,IAAI;aACb;YACD,OAAO,EAAE,CAAC,oBAAoB,CAAC;YAC/B,OAAO,EAAE,CAAC,oBAAoB,EAAE,uCAAuC,CAAC;YACxE,KAAK,EAAE;gBACL,kDAAkD,EAAE,MAAM;gBAC1D,mDAAmD,EAAE,MAAM;gBAC3D,mCAAmC,EAAE,KAAK;gBAC1C,oCAAoC,EAAE;oBACpC,MAAM;oBACN;wBACE,OAAO,EAAE;4BACP,WAAW,EAAE,sBAAW;4BACxB,KAAK,EAAE,gBAAgB;yBACxB;qBACF;iBACF;gBACD,4CAA4C,EAAE,MAAM;aACrD;SACF;QACD,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,IAAI,CAAC;YACf,OAAO,EAAE,CAAC,gBAAgB,CAAC;SAC5B;QACD,0BAA0B,EAAE;YAC1B,OAAO,EAAE,CAAC,IAAI,CAAC;YACf,OAAO,EAAE,CAAC,uBAAuB,CAAC;YAClC,KAAK,EAAE;gBACL,mCAAmC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;gBACtE,yCAAyC,EAAE,MAAM;aAClD;SACF;QACD,GAAG,EAAE;YACH,GAAG,EAAE;gBACH,IAAI,EAAE,IAAI;gBACV,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,IAAI;aACX;YACD,OAAO,EAAE,CAAC,oBAAoB,EAAE,MAAM,CAAC;YACvC,OAAO,EAAE;gBACP,oBAAoB;gBACpB,uCAAuC;gBACvC,oDAAoD;gBACpD,kDAAkD;gBAClD,6BAA6B;aAC9B;YACD,SAAS,EAAE;gBACT;oBACE,KAAK,EAAE,CAAC,cAAc,CAAC;oBACvB,KAAK,EAAE;wBACL,mCAAmC,EAAE,KAAK;wBAC1C,qBAAqB,EAAE,OAAO;qBAC/B;iBACF;aACF;YACD,KAAK,EAAE;gBACL,mBAAmB,EAAE,MAAM;gBAC3B,kDAAkD,EAAE,MAAM;gBAC1D,mCAAmC,EAAE,KAAK;gBAC1C,oCAAoC,EAAE;oBACpC,MAAM;oBACN;wBACE,OAAO,EAAE;4BACP,WAAW,EAAE,sBAAW;4BACxB,KAAK,EAAE,gBAAgB;yBACxB;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC"}
@@ -1,2 +0,0 @@
1
- declare const _default: string[];
2
- export default _default;
@@ -1,107 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = [
4
- // Index signature
5
- 'signature',
6
- 'call-signature',
7
- // Fields
8
- 'public-static-field',
9
- 'protected-static-field',
10
- 'private-static-field',
11
- '#private-static-field',
12
- 'public-decorated-field',
13
- 'protected-decorated-field',
14
- 'private-decorated-field',
15
- 'public-instance-field',
16
- 'protected-instance-field',
17
- 'private-instance-field',
18
- '#private-instance-field',
19
- 'public-abstract-field',
20
- 'protected-abstract-field',
21
- 'public-field',
22
- 'protected-field',
23
- 'private-field',
24
- '#private-field',
25
- 'static-field',
26
- 'instance-field',
27
- 'abstract-field',
28
- 'decorated-field',
29
- 'field',
30
- // Static initialization
31
- 'static-initialization',
32
- // Constructors
33
- 'public-constructor',
34
- 'protected-constructor',
35
- 'private-constructor',
36
- 'constructor',
37
- // Getters
38
- 'public-static-get',
39
- 'protected-static-get',
40
- 'private-static-get',
41
- '#private-static-get',
42
- 'public-decorated-get',
43
- 'protected-decorated-get',
44
- 'private-decorated-get',
45
- 'public-instance-get',
46
- 'protected-instance-get',
47
- 'private-instance-get',
48
- '#private-instance-get',
49
- 'public-abstract-get',
50
- 'protected-abstract-get',
51
- 'public-get',
52
- 'protected-get',
53
- 'private-get',
54
- '#private-get',
55
- 'static-get',
56
- 'instance-get',
57
- 'abstract-get',
58
- 'decorated-get',
59
- 'get',
60
- // Setters
61
- 'public-static-set',
62
- 'protected-static-set',
63
- 'private-static-set',
64
- '#private-static-set',
65
- 'public-decorated-set',
66
- 'protected-decorated-set',
67
- 'private-decorated-set',
68
- 'public-instance-set',
69
- 'protected-instance-set',
70
- 'private-instance-set',
71
- '#private-instance-set',
72
- 'public-abstract-set',
73
- 'protected-abstract-set',
74
- 'public-set',
75
- 'protected-set',
76
- 'private-set',
77
- '#private-set',
78
- 'static-set',
79
- 'instance-set',
80
- 'abstract-set',
81
- 'decorated-set',
82
- 'set',
83
- // Methods
84
- 'public-static-method',
85
- 'protected-static-method',
86
- 'private-static-method',
87
- '#private-static-method',
88
- 'public-decorated-method',
89
- 'protected-decorated-method',
90
- 'private-decorated-method',
91
- 'public-instance-method',
92
- 'protected-instance-method',
93
- 'private-instance-method',
94
- '#private-instance-method',
95
- 'public-abstract-method',
96
- 'protected-abstract-method',
97
- 'public-method',
98
- 'protected-method',
99
- 'private-method',
100
- '#private-method',
101
- 'static-method',
102
- 'instance-method',
103
- 'abstract-method',
104
- 'decorated-method',
105
- 'method',
106
- ];
107
- //# sourceMappingURL=member-order.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"member-order.js","sourceRoot":"","sources":["../../../src/member-order.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACb,kBAAkB;IAClB,WAAW;IACX,gBAAgB;IAChB,SAAS;IACT,qBAAqB;IACrB,wBAAwB;IACxB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