@robot-inventor/eslint-config 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 roboin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # eslint-config
2
+ My ESLint config preset
@@ -0,0 +1,3 @@
1
+ declare const eslintConfigNoJSDoc: import("@typescript-eslint/utils/dist/ts-eslint").FlatConfig.ConfigArray;
2
+ declare const eslintConfig: import("@typescript-eslint/utils/dist/ts-eslint").FlatConfig.ConfigArray;
3
+ export { eslintConfigNoJSDoc, eslintConfig };
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.eslintConfig = exports.eslintConfigNoJSDoc = void 0;
7
+ const js_1 = __importDefault(require("@eslint/js"));
8
+ const typescript_eslint_1 = __importDefault(require("typescript-eslint"));
9
+ const eslint_plugin_jsdoc_1 = __importDefault(require("eslint-plugin-jsdoc"));
10
+ const eslint_config_prettier_1 = __importDefault(require("eslint-config-prettier"));
11
+ const eslintConfigNoJSDoc = typescript_eslint_1.default.config(js_1.default.configs.all, eslint_plugin_jsdoc_1.default.configs["flat/recommended-typescript-error"], eslint_config_prettier_1.default, ...typescript_eslint_1.default.configs.recommendedTypeChecked, {
12
+ languageOptions: {
13
+ parserOptions: {
14
+ project: true,
15
+ // @ts-expect-error
16
+ tsconfigRootDir: import.meta.dirname
17
+ }
18
+ },
19
+ plugins: {
20
+ jsdoc: eslint_plugin_jsdoc_1.default
21
+ },
22
+ linterOptions: {
23
+ reportUnusedDisableDirectives: "error"
24
+ },
25
+ rules: {
26
+ "array-element-newline": ["error", "consistent"],
27
+ curly: ["error", "multi-line"],
28
+ "function-call-argument-newline": ["error", "consistent"],
29
+ "lines-between-class-members": [
30
+ "error",
31
+ "always",
32
+ {
33
+ exceptAfterSingleLine: true
34
+ }
35
+ ],
36
+ "max-len": [
37
+ "error",
38
+ {
39
+ code: 120
40
+ }
41
+ ],
42
+ "multiline-ternary": ["error", "always-multiline"],
43
+ "no-magic-numbers": [
44
+ "error",
45
+ {
46
+ ignoreArrayIndexes: true
47
+ }
48
+ ],
49
+ "no-ternary": "off",
50
+ "no-void": [
51
+ "error",
52
+ {
53
+ allowAsStatement: true
54
+ }
55
+ ],
56
+ "object-curly-spacing": ["error", "always"],
57
+ "one-var": ["error", "never"],
58
+ "padded-blocks": ["error", "never"],
59
+ "quote-props": ["error", "consistent-as-needed"],
60
+ "space-before-function-paren": [
61
+ "error",
62
+ {
63
+ anonymous: "always",
64
+ asyncArrow: "always",
65
+ named: "never"
66
+ }
67
+ ],
68
+ "no-plusplus": "off",
69
+ "no-extra-parens": [
70
+ "error",
71
+ "all",
72
+ {
73
+ nestedBinaryExpressions: false
74
+ }
75
+ ],
76
+ "no-new": "off",
77
+ "@typescript-eslint/explicit-function-return-type": "error",
78
+ "@typescript-eslint/explicit-member-accessibility": "error"
79
+ }
80
+ });
81
+ exports.eslintConfigNoJSDoc = eslintConfigNoJSDoc;
82
+ const JSDocRule = typescript_eslint_1.default.config({
83
+ rules: {
84
+ "jsdoc/require-jsdoc": [
85
+ "error",
86
+ {
87
+ require: {
88
+ ArrowFunctionExpression: true,
89
+ ClassDeclaration: true,
90
+ ClassExpression: true,
91
+ FunctionDeclaration: true,
92
+ FunctionExpression: true,
93
+ MethodDefinition: true
94
+ }
95
+ }
96
+ ]
97
+ }
98
+ });
99
+ const eslintConfig = typescript_eslint_1.default.config(...eslintConfigNoJSDoc, ...JSDocRule);
100
+ exports.eslintConfig = eslintConfig;
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@robot-inventor/eslint-config",
3
+ "version": "0.1.0",
4
+ "description": "My ESLint config preset",
5
+ "type": "commonjs",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "scripts": {
10
+ "build": "tsc -p . && tsc -p ./tsconfig.cjs.json && tsconfig-to-dual-package"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/Robot-Inventor/eslint-config.git"
15
+ },
16
+ "keywords": [
17
+ "eslint"
18
+ ],
19
+ "author": "Robot-Inventor",
20
+ "license": "MIT",
21
+ "bugs": {
22
+ "url": "https://github.com/Robot-Inventor/eslint-config/issues"
23
+ },
24
+ "homepage": "https://github.com/Robot-Inventor/eslint-config#readme",
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "dependencies": {
29
+ "@eslint/js": "^9.0.0",
30
+ "@types/eslint__js": "^8.42.3",
31
+ "@types/eslint-config-prettier": "^6.11.3",
32
+ "eslint-config-prettier": "^9.1.0",
33
+ "eslint-plugin-jsdoc": "^48.2.3",
34
+ "typescript-eslint": "^7.6.0"
35
+ },
36
+ "devDependencies": {
37
+ "tsconfig-to-dual-package": "^1.2.0",
38
+ "typescript": "^5.4.4"
39
+ }
40
+ }
@@ -0,0 +1,3 @@
1
+ declare const eslintConfigNoJSDoc: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
2
+ declare const eslintConfig: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
3
+ export { eslintConfigNoJSDoc, eslintConfig };
@@ -0,0 +1,93 @@
1
+ import eslint from "@eslint/js";
2
+ import tseslint from "typescript-eslint";
3
+ import jsdoc from "eslint-plugin-jsdoc";
4
+ import eslintConfigPrettier from "eslint-config-prettier";
5
+ const eslintConfigNoJSDoc = tseslint.config(eslint.configs.all, jsdoc.configs["flat/recommended-typescript-error"], eslintConfigPrettier, ...tseslint.configs.recommendedTypeChecked, {
6
+ languageOptions: {
7
+ parserOptions: {
8
+ project: true,
9
+ // @ts-expect-error
10
+ tsconfigRootDir: import.meta.dirname
11
+ }
12
+ },
13
+ plugins: {
14
+ jsdoc
15
+ },
16
+ linterOptions: {
17
+ reportUnusedDisableDirectives: "error"
18
+ },
19
+ rules: {
20
+ "array-element-newline": ["error", "consistent"],
21
+ curly: ["error", "multi-line"],
22
+ "function-call-argument-newline": ["error", "consistent"],
23
+ "lines-between-class-members": [
24
+ "error",
25
+ "always",
26
+ {
27
+ exceptAfterSingleLine: true
28
+ }
29
+ ],
30
+ "max-len": [
31
+ "error",
32
+ {
33
+ code: 120
34
+ }
35
+ ],
36
+ "multiline-ternary": ["error", "always-multiline"],
37
+ "no-magic-numbers": [
38
+ "error",
39
+ {
40
+ ignoreArrayIndexes: true
41
+ }
42
+ ],
43
+ "no-ternary": "off",
44
+ "no-void": [
45
+ "error",
46
+ {
47
+ allowAsStatement: true
48
+ }
49
+ ],
50
+ "object-curly-spacing": ["error", "always"],
51
+ "one-var": ["error", "never"],
52
+ "padded-blocks": ["error", "never"],
53
+ "quote-props": ["error", "consistent-as-needed"],
54
+ "space-before-function-paren": [
55
+ "error",
56
+ {
57
+ anonymous: "always",
58
+ asyncArrow: "always",
59
+ named: "never"
60
+ }
61
+ ],
62
+ "no-plusplus": "off",
63
+ "no-extra-parens": [
64
+ "error",
65
+ "all",
66
+ {
67
+ nestedBinaryExpressions: false
68
+ }
69
+ ],
70
+ "no-new": "off",
71
+ "@typescript-eslint/explicit-function-return-type": "error",
72
+ "@typescript-eslint/explicit-member-accessibility": "error"
73
+ }
74
+ });
75
+ const JSDocRule = tseslint.config({
76
+ rules: {
77
+ "jsdoc/require-jsdoc": [
78
+ "error",
79
+ {
80
+ require: {
81
+ ArrowFunctionExpression: true,
82
+ ClassDeclaration: true,
83
+ ClassExpression: true,
84
+ FunctionDeclaration: true,
85
+ FunctionExpression: true,
86
+ MethodDefinition: true
87
+ }
88
+ }
89
+ ]
90
+ }
91
+ });
92
+ const eslintConfig = tseslint.config(...eslintConfigNoJSDoc, ...JSDocRule);
93
+ export { eslintConfigNoJSDoc, eslintConfig };
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@robot-inventor/eslint-config",
3
+ "version": "0.1.0",
4
+ "description": "My ESLint config preset",
5
+ "type": "module",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "scripts": {
10
+ "build": "tsc -p . && tsc -p ./tsconfig.cjs.json && tsconfig-to-dual-package"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/Robot-Inventor/eslint-config.git"
15
+ },
16
+ "keywords": [
17
+ "eslint"
18
+ ],
19
+ "author": "Robot-Inventor",
20
+ "license": "MIT",
21
+ "bugs": {
22
+ "url": "https://github.com/Robot-Inventor/eslint-config/issues"
23
+ },
24
+ "homepage": "https://github.com/Robot-Inventor/eslint-config#readme",
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "dependencies": {
29
+ "@eslint/js": "^9.0.0",
30
+ "@types/eslint__js": "^8.42.3",
31
+ "@types/eslint-config-prettier": "^6.11.3",
32
+ "eslint-config-prettier": "^9.1.0",
33
+ "eslint-plugin-jsdoc": "^48.2.3",
34
+ "typescript-eslint": "^7.6.0"
35
+ },
36
+ "devDependencies": {
37
+ "tsconfig-to-dual-package": "^1.2.0",
38
+ "typescript": "^5.4.4"
39
+ }
40
+ }
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@robot-inventor/eslint-config",
3
+ "version": "0.1.0",
4
+ "description": "My ESLint config preset",
5
+ "main": "dist/index.js",
6
+ "type": "module",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "exports": {
11
+ ".": {
12
+ "import": {
13
+ "default": "./dist/esm/index.js"
14
+ },
15
+ "require": {
16
+ "default": "./dist/cjs/index.js"
17
+ }
18
+ }
19
+ },
20
+ "scripts": {
21
+ "build": "tsc -p . && tsc -p ./tsconfig.cjs.json && tsconfig-to-dual-package"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/Robot-Inventor/eslint-config.git"
26
+ },
27
+ "keywords": [
28
+ "eslint"
29
+ ],
30
+ "author": "Robot-Inventor",
31
+ "license": "MIT",
32
+ "bugs": {
33
+ "url": "https://github.com/Robot-Inventor/eslint-config/issues"
34
+ },
35
+ "homepage": "https://github.com/Robot-Inventor/eslint-config#readme",
36
+ "publishConfig": {
37
+ "access": "public"
38
+ },
39
+ "dependencies": {
40
+ "@eslint/js": "^9.0.0",
41
+ "@types/eslint__js": "^8.42.3",
42
+ "@types/eslint-config-prettier": "^6.11.3",
43
+ "eslint-config-prettier": "^9.1.0",
44
+ "eslint-plugin-jsdoc": "^48.2.3",
45
+ "typescript-eslint": "^7.6.0"
46
+ },
47
+ "devDependencies": {
48
+ "tsconfig-to-dual-package": "^1.2.0",
49
+ "typescript": "^5.4.4"
50
+ }
51
+ }