neatlint 1.1.6 → 1.1.8

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/README.md CHANGED
@@ -47,15 +47,13 @@ Strict ESLint presets for modern TypeScript projects.
47
47
 
48
48
  ## Features
49
49
 
50
- - Requires not using unnecessary types
51
- - Requires use of arrow functions
52
- - Requires the use of backtick
53
- - Requires specifying read only in classes
54
- - Requires specifying accessibility in classes
55
- - Forbids interfaces, only types are used
56
- - Unnecessary quotes are prevented on objects
57
- - Use of `var` is prohibited and it warns against using `const` and `let` when necessary
58
- - ... and more!
50
+ - Enforces type safety
51
+ - Encourages modern syntax
52
+ - Prohibits potentially unsafe patterns
53
+ - Requires explicit readonly and accessibility modifiers in classes
54
+ - Disallows interfaces, using only types
55
+ - Bans `var` and warns about proper use of `const` and `let`
56
+ - ...and much more!
59
57
 
60
58
  ## Installation
61
59
 
package/dist/main.d.mts CHANGED
@@ -1,4 +1,25 @@
1
- export { Neatlint } from './utils/Neatlint.util.mjs';
2
- export { ESLintConfig } from './types/ESLintConfig.type.mjs';
3
- export { NeatlintOptions } from './types/NeatlintOptions.type.mjs';
4
- import 'eslint';
1
+ import { Linter } from 'eslint';
2
+
3
+ type ESLintConfig = Linter.Config;
4
+
5
+ type NeatlintOptions = {
6
+ disabled?: boolean;
7
+ ignores?: ESLintConfig['ignores'];
8
+ javascript?: {
9
+ files?: ESLintConfig['files'];
10
+ languageOptions?: ESLintConfig['languageOptions'];
11
+ plugins?: ESLintConfig['plugins'];
12
+ rules?: ESLintConfig['rules'];
13
+ };
14
+ typescript?: {
15
+ files?: ESLintConfig['files'];
16
+ languageOptions?: ESLintConfig['languageOptions'];
17
+ plugins?: ESLintConfig['plugins'];
18
+ rules?: ESLintConfig['rules'];
19
+ };
20
+ config?: ESLintConfig[];
21
+ };
22
+
23
+ declare const Neatlint: (options?: NeatlintOptions) => ESLintConfig[];
24
+
25
+ export { type ESLintConfig, Neatlint, type NeatlintOptions };
package/dist/main.d.ts CHANGED
@@ -1,4 +1,25 @@
1
- export { Neatlint } from './utils/Neatlint.util.js';
2
- export { ESLintConfig } from './types/ESLintConfig.type.js';
3
- export { NeatlintOptions } from './types/NeatlintOptions.type.js';
4
- import 'eslint';
1
+ import { Linter } from 'eslint';
2
+
3
+ type ESLintConfig = Linter.Config;
4
+
5
+ type NeatlintOptions = {
6
+ disabled?: boolean;
7
+ ignores?: ESLintConfig['ignores'];
8
+ javascript?: {
9
+ files?: ESLintConfig['files'];
10
+ languageOptions?: ESLintConfig['languageOptions'];
11
+ plugins?: ESLintConfig['plugins'];
12
+ rules?: ESLintConfig['rules'];
13
+ };
14
+ typescript?: {
15
+ files?: ESLintConfig['files'];
16
+ languageOptions?: ESLintConfig['languageOptions'];
17
+ plugins?: ESLintConfig['plugins'];
18
+ rules?: ESLintConfig['rules'];
19
+ };
20
+ config?: ESLintConfig[];
21
+ };
22
+
23
+ declare const Neatlint: (options?: NeatlintOptions) => ESLintConfig[];
24
+
25
+ export { type ESLintConfig, Neatlint, type NeatlintOptions };
package/dist/main.js CHANGED
@@ -49,8 +49,24 @@ var NeatlintOptionsDefault = {
49
49
  plugins: {},
50
50
  rules: {
51
51
  ...import_js.default.configs.recommended.rules,
52
+ ...Object.assign(
53
+ {},
54
+ ...import_typescript_eslint.default.configs.strictTypeChecked.map(
55
+ (item) => Object.fromEntries(
56
+ Object.entries(item.rules ?? {}).filter(([key]) => !key.startsWith("@typescript-eslint")).map(([key]) => [key, "error"])
57
+ )
58
+ )
59
+ ),
60
+ ...Object.assign(
61
+ {},
62
+ ...import_typescript_eslint.default.configs.stylisticTypeChecked.map(
63
+ (item) => Object.fromEntries(
64
+ Object.entries(item.rules ?? {}).filter(([key]) => !key.startsWith("@typescript-eslint")).map(([key]) => [key, "error"])
65
+ )
66
+ )
67
+ ),
68
+ ...import_typescript_eslint.default.configs.eslintRecommended.rules,
52
69
  "no-undef": "off",
53
- "arrow-body-style": "error",
54
70
  "func-style": ["error", "expression", { allowArrowFunctions: true }],
55
71
  "no-duplicate-imports": "error",
56
72
  "no-eval": "error",
@@ -58,15 +74,11 @@ var NeatlintOptionsDefault = {
58
74
  "no-useless-call": "error",
59
75
  "no-useless-computed-key": "error",
60
76
  "no-useless-concat": "error",
61
- "no-useless-constructor": "error",
62
77
  "no-useless-rename": "error",
63
78
  "no-useless-return": "error",
64
- "no-var": "error",
65
79
  "object-shorthand": "error",
66
80
  "prefer-arrow-callback": "error",
67
- "prefer-const": "error",
68
81
  "prefer-template": "error",
69
- "require-await": "error",
70
82
  eqeqeq: "error"
71
83
  }
72
84
  },
package/dist/main.mjs CHANGED
@@ -13,8 +13,24 @@ var NeatlintOptionsDefault = {
13
13
  plugins: {},
14
14
  rules: {
15
15
  ...ESLintJS.configs.recommended.rules,
16
+ ...Object.assign(
17
+ {},
18
+ ...TSESLint.configs.strictTypeChecked.map(
19
+ (item) => Object.fromEntries(
20
+ Object.entries(item.rules ?? {}).filter(([key]) => !key.startsWith("@typescript-eslint")).map(([key]) => [key, "error"])
21
+ )
22
+ )
23
+ ),
24
+ ...Object.assign(
25
+ {},
26
+ ...TSESLint.configs.stylisticTypeChecked.map(
27
+ (item) => Object.fromEntries(
28
+ Object.entries(item.rules ?? {}).filter(([key]) => !key.startsWith("@typescript-eslint")).map(([key]) => [key, "error"])
29
+ )
30
+ )
31
+ ),
32
+ ...TSESLint.configs.eslintRecommended.rules,
16
33
  "no-undef": "off",
17
- "arrow-body-style": "error",
18
34
  "func-style": ["error", "expression", { allowArrowFunctions: true }],
19
35
  "no-duplicate-imports": "error",
20
36
  "no-eval": "error",
@@ -22,15 +38,11 @@ var NeatlintOptionsDefault = {
22
38
  "no-useless-call": "error",
23
39
  "no-useless-computed-key": "error",
24
40
  "no-useless-concat": "error",
25
- "no-useless-constructor": "error",
26
41
  "no-useless-rename": "error",
27
42
  "no-useless-return": "error",
28
- "no-var": "error",
29
43
  "object-shorthand": "error",
30
44
  "prefer-arrow-callback": "error",
31
- "prefer-const": "error",
32
45
  "prefer-template": "error",
33
- "require-await": "error",
34
46
  eqeqeq: "error"
35
47
  }
36
48
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neatlint",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "Strict ESLint presets for modern TypeScript projects.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/keift/neatlint",
@@ -15,9 +15,9 @@
15
15
  "lint": "eslint ./"
16
16
  },
17
17
  "dependencies": {
18
- "@eslint/js": "^9.35.0",
18
+ "@eslint/js": "^9.36.0",
19
19
  "@types/lodash": "^4.17.20",
20
- "eslint": "^9.35.0",
20
+ "eslint": "^9.36.0",
21
21
  "jiti": "^2.5.1",
22
22
  "lodash": "^4.17.21",
23
23
  "typescript": "^5.9.2",
@@ -1,3 +0,0 @@
1
- export { ESLintConfig } from '../types/ESLintConfig.type.mjs';
2
- export { NeatlintOptions } from '../types/NeatlintOptions.type.mjs';
3
- import 'eslint';
@@ -1,3 +0,0 @@
1
- export { ESLintConfig } from '../types/ESLintConfig.type.js';
2
- export { NeatlintOptions } from '../types/NeatlintOptions.type.js';
3
- import 'eslint';
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/barrels/Types.barrel.ts
17
- var Types_barrel_exports = {};
18
- module.exports = __toCommonJS(Types_barrel_exports);
File without changes
@@ -1,7 +0,0 @@
1
- import { NeatlintOptions } from '../types/NeatlintOptions.type.mjs';
2
- import '../types/ESLintConfig.type.mjs';
3
- import 'eslint';
4
-
5
- declare const NeatlintOptionsDefault: NeatlintOptions;
6
-
7
- export { NeatlintOptionsDefault };
@@ -1,7 +0,0 @@
1
- import { NeatlintOptions } from '../types/NeatlintOptions.type.js';
2
- import '../types/ESLintConfig.type.js';
3
- import 'eslint';
4
-
5
- declare const NeatlintOptionsDefault: NeatlintOptions;
6
-
7
- export { NeatlintOptionsDefault };
@@ -1,96 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/defaults/NeatlintOptions.default.ts
31
- var NeatlintOptions_default_exports = {};
32
- __export(NeatlintOptions_default_exports, {
33
- NeatlintOptionsDefault: () => NeatlintOptionsDefault
34
- });
35
- module.exports = __toCommonJS(NeatlintOptions_default_exports);
36
- var import_typescript_eslint = __toESM(require("typescript-eslint"));
37
- var import_js = __toESM(require("@eslint/js"));
38
- var NeatlintOptionsDefault = {
39
- disabled: false,
40
- ignores: ["./dist/**"],
41
- javascript: {
42
- files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts", "**/*.js", "**/*.jsx", "**/*.mjs", "**/*.cjs"],
43
- languageOptions: {},
44
- plugins: {},
45
- rules: {
46
- ...import_js.default.configs.recommended.rules,
47
- "no-undef": "off",
48
- "arrow-body-style": "error",
49
- "func-style": ["error", "expression", { allowArrowFunctions: true }],
50
- "no-duplicate-imports": "error",
51
- "no-eval": "error",
52
- "no-restricted-syntax": ["error", "DebuggerStatement", "EmptyStatement", "ForInStatement", "LabeledStatement", "SequenceExpression", "SwitchStatement", "WithStatement"],
53
- "no-useless-call": "error",
54
- "no-useless-computed-key": "error",
55
- "no-useless-concat": "error",
56
- "no-useless-constructor": "error",
57
- "no-useless-rename": "error",
58
- "no-useless-return": "error",
59
- "no-var": "error",
60
- "object-shorthand": "error",
61
- "prefer-arrow-callback": "error",
62
- "prefer-const": "error",
63
- "prefer-template": "error",
64
- "require-await": "error",
65
- eqeqeq: "error"
66
- }
67
- },
68
- typescript: {
69
- files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
70
- languageOptions: {
71
- parser: import_typescript_eslint.default.parser,
72
- parserOptions: {
73
- project: "./tsconfig.json",
74
- sourceType: "module"
75
- }
76
- },
77
- plugins: {
78
- "@typescript-eslint": import_typescript_eslint.default.plugin
79
- },
80
- rules: {
81
- ...Object.assign({}, ...import_typescript_eslint.default.configs.strictTypeChecked.map((item) => item.rules ?? {})),
82
- ...Object.assign({}, ...import_typescript_eslint.default.configs.stylisticTypeChecked.map((item) => item.rules ?? {})),
83
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
84
- // stylisticTypeChecked but different
85
- "@typescript-eslint/consistent-type-exports": "error",
86
- "@typescript-eslint/consistent-type-imports": "error",
87
- "@typescript-eslint/explicit-member-accessibility": "error",
88
- "@typescript-eslint/prefer-readonly": "error",
89
- "@typescript-eslint/strict-boolean-expressions": "error"
90
- }
91
- }
92
- };
93
- // Annotate the CommonJS export names for ESM import in node:
94
- 0 && (module.exports = {
95
- NeatlintOptionsDefault
96
- });
@@ -1,61 +0,0 @@
1
- // src/defaults/NeatlintOptions.default.ts
2
- import TSESLint from "typescript-eslint";
3
- import ESLintJS from "@eslint/js";
4
- var NeatlintOptionsDefault = {
5
- disabled: false,
6
- ignores: ["./dist/**"],
7
- javascript: {
8
- files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts", "**/*.js", "**/*.jsx", "**/*.mjs", "**/*.cjs"],
9
- languageOptions: {},
10
- plugins: {},
11
- rules: {
12
- ...ESLintJS.configs.recommended.rules,
13
- "no-undef": "off",
14
- "arrow-body-style": "error",
15
- "func-style": ["error", "expression", { allowArrowFunctions: true }],
16
- "no-duplicate-imports": "error",
17
- "no-eval": "error",
18
- "no-restricted-syntax": ["error", "DebuggerStatement", "EmptyStatement", "ForInStatement", "LabeledStatement", "SequenceExpression", "SwitchStatement", "WithStatement"],
19
- "no-useless-call": "error",
20
- "no-useless-computed-key": "error",
21
- "no-useless-concat": "error",
22
- "no-useless-constructor": "error",
23
- "no-useless-rename": "error",
24
- "no-useless-return": "error",
25
- "no-var": "error",
26
- "object-shorthand": "error",
27
- "prefer-arrow-callback": "error",
28
- "prefer-const": "error",
29
- "prefer-template": "error",
30
- "require-await": "error",
31
- eqeqeq: "error"
32
- }
33
- },
34
- typescript: {
35
- files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
36
- languageOptions: {
37
- parser: TSESLint.parser,
38
- parserOptions: {
39
- project: "./tsconfig.json",
40
- sourceType: "module"
41
- }
42
- },
43
- plugins: {
44
- "@typescript-eslint": TSESLint.plugin
45
- },
46
- rules: {
47
- ...Object.assign({}, ...TSESLint.configs.strictTypeChecked.map((item) => item.rules ?? {})),
48
- ...Object.assign({}, ...TSESLint.configs.stylisticTypeChecked.map((item) => item.rules ?? {})),
49
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
50
- // stylisticTypeChecked but different
51
- "@typescript-eslint/consistent-type-exports": "error",
52
- "@typescript-eslint/consistent-type-imports": "error",
53
- "@typescript-eslint/explicit-member-accessibility": "error",
54
- "@typescript-eslint/prefer-readonly": "error",
55
- "@typescript-eslint/strict-boolean-expressions": "error"
56
- }
57
- }
58
- };
59
- export {
60
- NeatlintOptionsDefault
61
- };
@@ -1,5 +0,0 @@
1
- import { Linter } from 'eslint';
2
-
3
- type ESLintConfig = Linter.Config;
4
-
5
- export type { ESLintConfig };
@@ -1,5 +0,0 @@
1
- import { Linter } from 'eslint';
2
-
3
- type ESLintConfig = Linter.Config;
4
-
5
- export type { ESLintConfig };
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/types/ESLintConfig.type.ts
17
- var ESLintConfig_type_exports = {};
18
- module.exports = __toCommonJS(ESLintConfig_type_exports);
File without changes
@@ -1,22 +0,0 @@
1
- import { ESLintConfig } from './ESLintConfig.type.mjs';
2
- import 'eslint';
3
-
4
- type NeatlintOptions = {
5
- disabled?: boolean;
6
- ignores?: ESLintConfig['ignores'];
7
- javascript?: {
8
- files?: ESLintConfig['files'];
9
- languageOptions?: ESLintConfig['languageOptions'];
10
- plugins?: ESLintConfig['plugins'];
11
- rules?: ESLintConfig['rules'];
12
- };
13
- typescript?: {
14
- files?: ESLintConfig['files'];
15
- languageOptions?: ESLintConfig['languageOptions'];
16
- plugins?: ESLintConfig['plugins'];
17
- rules?: ESLintConfig['rules'];
18
- };
19
- config?: ESLintConfig[];
20
- };
21
-
22
- export type { NeatlintOptions };
@@ -1,22 +0,0 @@
1
- import { ESLintConfig } from './ESLintConfig.type.js';
2
- import 'eslint';
3
-
4
- type NeatlintOptions = {
5
- disabled?: boolean;
6
- ignores?: ESLintConfig['ignores'];
7
- javascript?: {
8
- files?: ESLintConfig['files'];
9
- languageOptions?: ESLintConfig['languageOptions'];
10
- plugins?: ESLintConfig['plugins'];
11
- rules?: ESLintConfig['rules'];
12
- };
13
- typescript?: {
14
- files?: ESLintConfig['files'];
15
- languageOptions?: ESLintConfig['languageOptions'];
16
- plugins?: ESLintConfig['plugins'];
17
- rules?: ESLintConfig['rules'];
18
- };
19
- config?: ESLintConfig[];
20
- };
21
-
22
- export type { NeatlintOptions };
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/types/NeatlintOptions.type.ts
17
- var NeatlintOptions_type_exports = {};
18
- module.exports = __toCommonJS(NeatlintOptions_type_exports);
File without changes
@@ -1,7 +0,0 @@
1
- import { ESLintConfig } from '../types/ESLintConfig.type.mjs';
2
- import { NeatlintOptions } from '../types/NeatlintOptions.type.mjs';
3
- import 'eslint';
4
-
5
- declare const Neatlint: (options?: NeatlintOptions) => ESLintConfig[];
6
-
7
- export { Neatlint };
@@ -1,7 +0,0 @@
1
- import { ESLintConfig } from '../types/ESLintConfig.type.js';
2
- import { NeatlintOptions } from '../types/NeatlintOptions.type.js';
3
- import 'eslint';
4
-
5
- declare const Neatlint: (options?: NeatlintOptions) => ESLintConfig[];
6
-
7
- export { Neatlint };
@@ -1,120 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/utils/Neatlint.util.ts
31
- var Neatlint_util_exports = {};
32
- __export(Neatlint_util_exports, {
33
- Neatlint: () => Neatlint
34
- });
35
- module.exports = __toCommonJS(Neatlint_util_exports);
36
- var import_lodash = __toESM(require("lodash"));
37
-
38
- // src/defaults/NeatlintOptions.default.ts
39
- var import_typescript_eslint = __toESM(require("typescript-eslint"));
40
- var import_js = __toESM(require("@eslint/js"));
41
- var NeatlintOptionsDefault = {
42
- disabled: false,
43
- ignores: ["./dist/**"],
44
- javascript: {
45
- files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts", "**/*.js", "**/*.jsx", "**/*.mjs", "**/*.cjs"],
46
- languageOptions: {},
47
- plugins: {},
48
- rules: {
49
- ...import_js.default.configs.recommended.rules,
50
- "no-undef": "off",
51
- "arrow-body-style": "error",
52
- "func-style": ["error", "expression", { allowArrowFunctions: true }],
53
- "no-duplicate-imports": "error",
54
- "no-eval": "error",
55
- "no-restricted-syntax": ["error", "DebuggerStatement", "EmptyStatement", "ForInStatement", "LabeledStatement", "SequenceExpression", "SwitchStatement", "WithStatement"],
56
- "no-useless-call": "error",
57
- "no-useless-computed-key": "error",
58
- "no-useless-concat": "error",
59
- "no-useless-constructor": "error",
60
- "no-useless-rename": "error",
61
- "no-useless-return": "error",
62
- "no-var": "error",
63
- "object-shorthand": "error",
64
- "prefer-arrow-callback": "error",
65
- "prefer-const": "error",
66
- "prefer-template": "error",
67
- "require-await": "error",
68
- eqeqeq: "error"
69
- }
70
- },
71
- typescript: {
72
- files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
73
- languageOptions: {
74
- parser: import_typescript_eslint.default.parser,
75
- parserOptions: {
76
- project: "./tsconfig.json",
77
- sourceType: "module"
78
- }
79
- },
80
- plugins: {
81
- "@typescript-eslint": import_typescript_eslint.default.plugin
82
- },
83
- rules: {
84
- ...Object.assign({}, ...import_typescript_eslint.default.configs.strictTypeChecked.map((item) => item.rules ?? {})),
85
- ...Object.assign({}, ...import_typescript_eslint.default.configs.stylisticTypeChecked.map((item) => item.rules ?? {})),
86
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
87
- // stylisticTypeChecked but different
88
- "@typescript-eslint/consistent-type-exports": "error",
89
- "@typescript-eslint/consistent-type-imports": "error",
90
- "@typescript-eslint/explicit-member-accessibility": "error",
91
- "@typescript-eslint/prefer-readonly": "error",
92
- "@typescript-eslint/strict-boolean-expressions": "error"
93
- }
94
- }
95
- };
96
-
97
- // src/utils/Neatlint.util.ts
98
- var Neatlint = (options = NeatlintOptionsDefault) => {
99
- options = import_lodash.default.merge({}, NeatlintOptionsDefault, options);
100
- return [
101
- { ignores: options.ignores },
102
- {
103
- files: options.javascript?.files,
104
- languageOptions: options.javascript?.languageOptions,
105
- plugins: options.javascript?.plugins,
106
- rules: options.disabled === true ? {} : options.javascript?.rules
107
- },
108
- {
109
- files: options.typescript?.files,
110
- languageOptions: options.typescript?.languageOptions,
111
- plugins: options.typescript?.plugins,
112
- rules: options.disabled === true ? {} : options.typescript?.rules
113
- },
114
- ...options.config && options.config.length !== 0 ? options.config : []
115
- ];
116
- };
117
- // Annotate the CommonJS export names for ESM import in node:
118
- 0 && (module.exports = {
119
- Neatlint
120
- });
@@ -1,85 +0,0 @@
1
- // src/utils/Neatlint.util.ts
2
- import _ from "lodash";
3
-
4
- // src/defaults/NeatlintOptions.default.ts
5
- import TSESLint from "typescript-eslint";
6
- import ESLintJS from "@eslint/js";
7
- var NeatlintOptionsDefault = {
8
- disabled: false,
9
- ignores: ["./dist/**"],
10
- javascript: {
11
- files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts", "**/*.js", "**/*.jsx", "**/*.mjs", "**/*.cjs"],
12
- languageOptions: {},
13
- plugins: {},
14
- rules: {
15
- ...ESLintJS.configs.recommended.rules,
16
- "no-undef": "off",
17
- "arrow-body-style": "error",
18
- "func-style": ["error", "expression", { allowArrowFunctions: true }],
19
- "no-duplicate-imports": "error",
20
- "no-eval": "error",
21
- "no-restricted-syntax": ["error", "DebuggerStatement", "EmptyStatement", "ForInStatement", "LabeledStatement", "SequenceExpression", "SwitchStatement", "WithStatement"],
22
- "no-useless-call": "error",
23
- "no-useless-computed-key": "error",
24
- "no-useless-concat": "error",
25
- "no-useless-constructor": "error",
26
- "no-useless-rename": "error",
27
- "no-useless-return": "error",
28
- "no-var": "error",
29
- "object-shorthand": "error",
30
- "prefer-arrow-callback": "error",
31
- "prefer-const": "error",
32
- "prefer-template": "error",
33
- "require-await": "error",
34
- eqeqeq: "error"
35
- }
36
- },
37
- typescript: {
38
- files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
39
- languageOptions: {
40
- parser: TSESLint.parser,
41
- parserOptions: {
42
- project: "./tsconfig.json",
43
- sourceType: "module"
44
- }
45
- },
46
- plugins: {
47
- "@typescript-eslint": TSESLint.plugin
48
- },
49
- rules: {
50
- ...Object.assign({}, ...TSESLint.configs.strictTypeChecked.map((item) => item.rules ?? {})),
51
- ...Object.assign({}, ...TSESLint.configs.stylisticTypeChecked.map((item) => item.rules ?? {})),
52
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
53
- // stylisticTypeChecked but different
54
- "@typescript-eslint/consistent-type-exports": "error",
55
- "@typescript-eslint/consistent-type-imports": "error",
56
- "@typescript-eslint/explicit-member-accessibility": "error",
57
- "@typescript-eslint/prefer-readonly": "error",
58
- "@typescript-eslint/strict-boolean-expressions": "error"
59
- }
60
- }
61
- };
62
-
63
- // src/utils/Neatlint.util.ts
64
- var Neatlint = (options = NeatlintOptionsDefault) => {
65
- options = _.merge({}, NeatlintOptionsDefault, options);
66
- return [
67
- { ignores: options.ignores },
68
- {
69
- files: options.javascript?.files,
70
- languageOptions: options.javascript?.languageOptions,
71
- plugins: options.javascript?.plugins,
72
- rules: options.disabled === true ? {} : options.javascript?.rules
73
- },
74
- {
75
- files: options.typescript?.files,
76
- languageOptions: options.typescript?.languageOptions,
77
- plugins: options.typescript?.plugins,
78
- rules: options.disabled === true ? {} : options.typescript?.rules
79
- },
80
- ...options.config && options.config.length !== 0 ? options.config : []
81
- ];
82
- };
83
- export {
84
- Neatlint
85
- };