neatlint 1.1.3 → 1.1.5

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
@@ -9,6 +9,7 @@
9
9
  [Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
10
10
  [Void]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined
11
11
  [NeatlintOptionsDefault]: https://github.com/keift/neatlint/blob/main/src/defaults/NeatlintOptions.default.ts
12
+ [ESLintConfig]: https://github.com/eslint/eslint/blob/main/lib/types/index.d.ts#L1748
12
13
  [NeatlintOptions]: https://github.com/keift/neatlint/blob/main/src/types/NeatlintOptions.type.ts
13
14
 
14
15
  <div align="center">
@@ -52,8 +53,8 @@ Strict ESLint presets for modern TypeScript projects.
52
53
  - Requires specifying read only in classes
53
54
  - Requires specifying accessibility in classes
54
55
  - Forbids interfaces, only types are used
56
+ - Unnecessary quotes are prevented on objects
55
57
  - Use of `var` is prohibited and it warns against using `const` and `let` when necessary
56
- - Unnecessary quotes are prevented on objects, requiring the use of double or single quotes
57
58
  - ... and more!
58
59
 
59
60
  ## Installation
@@ -113,7 +114,7 @@ Get the ESLint configuration generated by Neatlint.
113
114
  > | --------- | ------------------------ | -------------------------------------------------- |
114
115
  > | options | [NeatlintOptionsDefault] | [NeatlintOptions] (optional)<br/>Neatlint options. |
115
116
  >
116
- > returns [Object]
117
+ > returns [ESLintConfig]\[]
117
118
  >
118
119
  > Example:
119
120
  >
@@ -169,6 +170,7 @@ Suggested uses are as follows. We recommend using [Prettier](https://npmjs.com/p
169
170
 
170
171
  | Type |
171
172
  | ----------------- |
173
+ | [ESLintConfig] |
172
174
  | [NeatlintOptions] |
173
175
 
174
176
  ## Links
@@ -1 +1,3 @@
1
+ export { ESLintConfig } from '../types/ESLintConfig.type.mjs';
1
2
  export { NeatlintOptions } from '../types/NeatlintOptions.type.mjs';
3
+ import 'eslint';
@@ -1 +1,3 @@
1
+ export { ESLintConfig } from '../types/ESLintConfig.type.js';
1
2
  export { NeatlintOptions } from '../types/NeatlintOptions.type.js';
3
+ import 'eslint';
@@ -1,4 +1,6 @@
1
1
  import { NeatlintOptions } from '../types/NeatlintOptions.type.mjs';
2
+ import '../types/ESLintConfig.type.mjs';
3
+ import 'eslint';
2
4
 
3
5
  declare const NeatlintOptionsDefault: NeatlintOptions;
4
6
 
@@ -1,4 +1,6 @@
1
1
  import { NeatlintOptions } from '../types/NeatlintOptions.type.js';
2
+ import '../types/ESLintConfig.type.js';
3
+ import 'eslint';
2
4
 
3
5
  declare const NeatlintOptionsDefault: NeatlintOptions;
4
6
 
@@ -48,7 +48,8 @@ var NeatlintOptionsDefault = {
48
48
  "arrow-body-style": "error",
49
49
  "func-style": ["error", "expression", { allowArrowFunctions: true }],
50
50
  "no-duplicate-imports": "error",
51
- "no-restricted-syntax": ["error", "SwitchStatement"],
51
+ "no-eval": "error",
52
+ "no-restricted-syntax": ["error", "DebuggerStatement", "EmptyStatement", "ForInStatement", "LabeledStatement", "SequenceExpression", "SwitchStatement", "WithStatement"],
52
53
  "no-useless-computed-key": "error",
53
54
  "no-useless-concat": "error",
54
55
  "no-useless-constructor": "error",
@@ -82,7 +83,6 @@ var NeatlintOptionsDefault = {
82
83
  // stylisticTypeChecked but different
83
84
  "@typescript-eslint/consistent-type-exports": "error",
84
85
  "@typescript-eslint/consistent-type-imports": "error",
85
- "@typescript-eslint/explicit-function-return-type": "error",
86
86
  "@typescript-eslint/explicit-member-accessibility": "error",
87
87
  "@typescript-eslint/no-inferrable-types": "error",
88
88
  // stylisticTypeChecked
@@ -14,7 +14,8 @@ var NeatlintOptionsDefault = {
14
14
  "arrow-body-style": "error",
15
15
  "func-style": ["error", "expression", { allowArrowFunctions: true }],
16
16
  "no-duplicate-imports": "error",
17
- "no-restricted-syntax": ["error", "SwitchStatement"],
17
+ "no-eval": "error",
18
+ "no-restricted-syntax": ["error", "DebuggerStatement", "EmptyStatement", "ForInStatement", "LabeledStatement", "SequenceExpression", "SwitchStatement", "WithStatement"],
18
19
  "no-useless-computed-key": "error",
19
20
  "no-useless-concat": "error",
20
21
  "no-useless-constructor": "error",
@@ -48,7 +49,6 @@ var NeatlintOptionsDefault = {
48
49
  // stylisticTypeChecked but different
49
50
  "@typescript-eslint/consistent-type-exports": "error",
50
51
  "@typescript-eslint/consistent-type-imports": "error",
51
- "@typescript-eslint/explicit-function-return-type": "error",
52
52
  "@typescript-eslint/explicit-member-accessibility": "error",
53
53
  "@typescript-eslint/no-inferrable-types": "error",
54
54
  // stylisticTypeChecked
package/dist/main.d.mts CHANGED
@@ -1,2 +1,4 @@
1
1
  export { Neatlint } from './utils/Neatlint.util.mjs';
2
+ export { ESLintConfig } from './types/ESLintConfig.type.mjs';
2
3
  export { NeatlintOptions } from './types/NeatlintOptions.type.mjs';
4
+ import 'eslint';
package/dist/main.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export { Neatlint } from './utils/Neatlint.util.js';
2
+ export { ESLintConfig } from './types/ESLintConfig.type.js';
2
3
  export { NeatlintOptions } from './types/NeatlintOptions.type.js';
4
+ import 'eslint';
package/dist/main.js CHANGED
@@ -53,7 +53,8 @@ var NeatlintOptionsDefault = {
53
53
  "arrow-body-style": "error",
54
54
  "func-style": ["error", "expression", { allowArrowFunctions: true }],
55
55
  "no-duplicate-imports": "error",
56
- "no-restricted-syntax": ["error", "SwitchStatement"],
56
+ "no-eval": "error",
57
+ "no-restricted-syntax": ["error", "DebuggerStatement", "EmptyStatement", "ForInStatement", "LabeledStatement", "SequenceExpression", "SwitchStatement", "WithStatement"],
57
58
  "no-useless-computed-key": "error",
58
59
  "no-useless-concat": "error",
59
60
  "no-useless-constructor": "error",
@@ -87,7 +88,6 @@ var NeatlintOptionsDefault = {
87
88
  // stylisticTypeChecked but different
88
89
  "@typescript-eslint/consistent-type-exports": "error",
89
90
  "@typescript-eslint/consistent-type-imports": "error",
90
- "@typescript-eslint/explicit-function-return-type": "error",
91
91
  "@typescript-eslint/explicit-member-accessibility": "error",
92
92
  "@typescript-eslint/no-inferrable-types": "error",
93
93
  // stylisticTypeChecked
package/dist/main.mjs CHANGED
@@ -17,7 +17,8 @@ var NeatlintOptionsDefault = {
17
17
  "arrow-body-style": "error",
18
18
  "func-style": ["error", "expression", { allowArrowFunctions: true }],
19
19
  "no-duplicate-imports": "error",
20
- "no-restricted-syntax": ["error", "SwitchStatement"],
20
+ "no-eval": "error",
21
+ "no-restricted-syntax": ["error", "DebuggerStatement", "EmptyStatement", "ForInStatement", "LabeledStatement", "SequenceExpression", "SwitchStatement", "WithStatement"],
21
22
  "no-useless-computed-key": "error",
22
23
  "no-useless-concat": "error",
23
24
  "no-useless-constructor": "error",
@@ -51,7 +52,6 @@ var NeatlintOptionsDefault = {
51
52
  // stylisticTypeChecked but different
52
53
  "@typescript-eslint/consistent-type-exports": "error",
53
54
  "@typescript-eslint/consistent-type-imports": "error",
54
- "@typescript-eslint/explicit-function-return-type": "error",
55
55
  "@typescript-eslint/explicit-member-accessibility": "error",
56
56
  "@typescript-eslint/no-inferrable-types": "error",
57
57
  // stylisticTypeChecked
@@ -0,0 +1,5 @@
1
+ import { Linter } from 'eslint';
2
+
3
+ type ESLintConfig = Linter.Config;
4
+
5
+ export type { ESLintConfig };
@@ -0,0 +1,5 @@
1
+ import { Linter } from 'eslint';
2
+
3
+ type ESLintConfig = Linter.Config;
4
+
5
+ export type { ESLintConfig };
@@ -0,0 +1,18 @@
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,23 +1,22 @@
1
+ import { ESLintConfig } from './ESLintConfig.type.mjs';
2
+ import 'eslint';
3
+
1
4
  type NeatlintOptions = {
2
5
  disabled?: boolean;
3
- ignores?: string[];
6
+ ignores?: ESLintConfig["ignores"];
4
7
  javascript?: {
5
- files?: string[];
6
- languageOptions?: object;
7
- plugins?: Record<string, unknown>;
8
- rules?: Record<string, string | object>;
8
+ files?: ESLintConfig["files"];
9
+ languageOptions?: ESLintConfig["languageOptions"];
10
+ plugins?: ESLintConfig["plugins"];
11
+ rules?: ESLintConfig["rules"];
9
12
  };
10
13
  typescript?: {
11
- files?: string[];
12
- languageOptions?: object;
13
- plugins?: Record<string, unknown>;
14
- rules?: Record<string, string | object>;
14
+ files?: ESLintConfig["files"];
15
+ languageOptions?: ESLintConfig["languageOptions"];
16
+ plugins?: ESLintConfig["plugins"];
17
+ rules?: ESLintConfig["rules"];
15
18
  };
16
- config?: {
17
- files: string[];
18
- [key: string]: unknown;
19
- rules: Record<string, string | object>;
20
- }[];
19
+ config?: ESLintConfig[];
21
20
  };
22
21
 
23
22
  export type { NeatlintOptions };
@@ -1,23 +1,22 @@
1
+ import { ESLintConfig } from './ESLintConfig.type.js';
2
+ import 'eslint';
3
+
1
4
  type NeatlintOptions = {
2
5
  disabled?: boolean;
3
- ignores?: string[];
6
+ ignores?: ESLintConfig["ignores"];
4
7
  javascript?: {
5
- files?: string[];
6
- languageOptions?: object;
7
- plugins?: Record<string, unknown>;
8
- rules?: Record<string, string | object>;
8
+ files?: ESLintConfig["files"];
9
+ languageOptions?: ESLintConfig["languageOptions"];
10
+ plugins?: ESLintConfig["plugins"];
11
+ rules?: ESLintConfig["rules"];
9
12
  };
10
13
  typescript?: {
11
- files?: string[];
12
- languageOptions?: object;
13
- plugins?: Record<string, unknown>;
14
- rules?: Record<string, string | object>;
14
+ files?: ESLintConfig["files"];
15
+ languageOptions?: ESLintConfig["languageOptions"];
16
+ plugins?: ESLintConfig["plugins"];
17
+ rules?: ESLintConfig["rules"];
15
18
  };
16
- config?: {
17
- files: string[];
18
- [key: string]: unknown;
19
- rules: Record<string, string | object>;
20
- }[];
19
+ config?: ESLintConfig[];
21
20
  };
22
21
 
23
22
  export type { NeatlintOptions };
@@ -1,5 +1,7 @@
1
+ import { ESLintConfig } from '../types/ESLintConfig.type.mjs';
1
2
  import { NeatlintOptions } from '../types/NeatlintOptions.type.mjs';
3
+ import 'eslint';
2
4
 
3
- declare const Neatlint: (options?: NeatlintOptions) => object;
5
+ declare const Neatlint: (options?: NeatlintOptions) => ESLintConfig[];
4
6
 
5
7
  export { Neatlint };
@@ -1,5 +1,7 @@
1
+ import { ESLintConfig } from '../types/ESLintConfig.type.js';
1
2
  import { NeatlintOptions } from '../types/NeatlintOptions.type.js';
3
+ import 'eslint';
2
4
 
3
- declare const Neatlint: (options?: NeatlintOptions) => object;
5
+ declare const Neatlint: (options?: NeatlintOptions) => ESLintConfig[];
4
6
 
5
7
  export { Neatlint };
@@ -51,7 +51,8 @@ var NeatlintOptionsDefault = {
51
51
  "arrow-body-style": "error",
52
52
  "func-style": ["error", "expression", { allowArrowFunctions: true }],
53
53
  "no-duplicate-imports": "error",
54
- "no-restricted-syntax": ["error", "SwitchStatement"],
54
+ "no-eval": "error",
55
+ "no-restricted-syntax": ["error", "DebuggerStatement", "EmptyStatement", "ForInStatement", "LabeledStatement", "SequenceExpression", "SwitchStatement", "WithStatement"],
55
56
  "no-useless-computed-key": "error",
56
57
  "no-useless-concat": "error",
57
58
  "no-useless-constructor": "error",
@@ -85,7 +86,6 @@ var NeatlintOptionsDefault = {
85
86
  // stylisticTypeChecked but different
86
87
  "@typescript-eslint/consistent-type-exports": "error",
87
88
  "@typescript-eslint/consistent-type-imports": "error",
88
- "@typescript-eslint/explicit-function-return-type": "error",
89
89
  "@typescript-eslint/explicit-member-accessibility": "error",
90
90
  "@typescript-eslint/no-inferrable-types": "error",
91
91
  // stylisticTypeChecked
@@ -17,7 +17,8 @@ var NeatlintOptionsDefault = {
17
17
  "arrow-body-style": "error",
18
18
  "func-style": ["error", "expression", { allowArrowFunctions: true }],
19
19
  "no-duplicate-imports": "error",
20
- "no-restricted-syntax": ["error", "SwitchStatement"],
20
+ "no-eval": "error",
21
+ "no-restricted-syntax": ["error", "DebuggerStatement", "EmptyStatement", "ForInStatement", "LabeledStatement", "SequenceExpression", "SwitchStatement", "WithStatement"],
21
22
  "no-useless-computed-key": "error",
22
23
  "no-useless-concat": "error",
23
24
  "no-useless-constructor": "error",
@@ -51,7 +52,6 @@ var NeatlintOptionsDefault = {
51
52
  // stylisticTypeChecked but different
52
53
  "@typescript-eslint/consistent-type-exports": "error",
53
54
  "@typescript-eslint/consistent-type-imports": "error",
54
- "@typescript-eslint/explicit-function-return-type": "error",
55
55
  "@typescript-eslint/explicit-member-accessibility": "error",
56
56
  "@typescript-eslint/no-inferrable-types": "error",
57
57
  // stylisticTypeChecked
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neatlint",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "Strict ESLint presets for modern TypeScript projects.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/keift/neatlint",
@@ -10,17 +10,18 @@
10
10
  "types": "./dist/main.d.ts",
11
11
  "scripts": {
12
12
  "tests": "bun run lint && bun test",
13
- "prettier": "prettier --write ./",
14
13
  "build": "tsup",
14
+ "prettier": "prettier --write ./",
15
15
  "lint": "eslint ./"
16
16
  },
17
17
  "dependencies": {
18
18
  "@eslint/js": "^9.35.0",
19
19
  "@types/lodash": "^4.17.20",
20
+ "eslint": "^9.35.0",
20
21
  "jiti": "^2.5.1",
21
22
  "lodash": "^4.17.21",
22
23
  "typescript": "^5.9.2",
23
- "typescript-eslint": "^8.43.0"
24
+ "typescript-eslint": "^8.44.0"
24
25
  },
25
26
  "devDependencies": {
26
27
  "prettier": "^3.6.2",