neatlint 1.1.4 → 1.1.6

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
@@ -98,7 +99,7 @@ Briefly as follows.
98
99
  > **📁 ./eslint.config.ts**
99
100
  >
100
101
  > ```typescript
101
- > import { Neatlint } from "neatlint";
102
+ > import { Neatlint } from 'neatlint';
102
103
  >
103
104
  > export default Neatlint();
104
105
  > ```
@@ -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
  >
@@ -128,7 +129,7 @@ Suggested uses are as follows. We recommend using [Prettier](https://npmjs.com/p
128
129
  > **📁 ./eslint.config.ts**
129
130
  >
130
131
  > ```typescript
131
- > import { Neatlint } from "neatlint";
132
+ > import { Neatlint } from 'neatlint';
132
133
  >
133
134
  > export default Neatlint();
134
135
  > ```
@@ -156,7 +157,7 @@ Suggested uses are as follows. We recommend using [Prettier](https://npmjs.com/p
156
157
  > ```json
157
158
  > {
158
159
  > "semi": true,
159
- > "singleQuote": false,
160
+ > "singleQuote": true,
160
161
  >
161
162
  > "printWidth": 9999,
162
163
  > "tabWidth": 2,
@@ -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,9 @@ 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"],
53
+ "no-useless-call": "error",
52
54
  "no-useless-computed-key": "error",
53
55
  "no-useless-concat": "error",
54
56
  "no-useless-constructor": "error",
@@ -82,10 +84,7 @@ var NeatlintOptionsDefault = {
82
84
  // stylisticTypeChecked but different
83
85
  "@typescript-eslint/consistent-type-exports": "error",
84
86
  "@typescript-eslint/consistent-type-imports": "error",
85
- "@typescript-eslint/explicit-function-return-type": "error",
86
87
  "@typescript-eslint/explicit-member-accessibility": "error",
87
- "@typescript-eslint/no-inferrable-types": "error",
88
- // stylisticTypeChecked
89
88
  "@typescript-eslint/prefer-readonly": "error",
90
89
  "@typescript-eslint/strict-boolean-expressions": "error"
91
90
  }
@@ -14,7 +14,9 @@ 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"],
19
+ "no-useless-call": "error",
18
20
  "no-useless-computed-key": "error",
19
21
  "no-useless-concat": "error",
20
22
  "no-useless-constructor": "error",
@@ -48,10 +50,7 @@ var NeatlintOptionsDefault = {
48
50
  // stylisticTypeChecked but different
49
51
  "@typescript-eslint/consistent-type-exports": "error",
50
52
  "@typescript-eslint/consistent-type-imports": "error",
51
- "@typescript-eslint/explicit-function-return-type": "error",
52
53
  "@typescript-eslint/explicit-member-accessibility": "error",
53
- "@typescript-eslint/no-inferrable-types": "error",
54
- // stylisticTypeChecked
55
54
  "@typescript-eslint/prefer-readonly": "error",
56
55
  "@typescript-eslint/strict-boolean-expressions": "error"
57
56
  }
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,9 @@ 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"],
58
+ "no-useless-call": "error",
57
59
  "no-useless-computed-key": "error",
58
60
  "no-useless-concat": "error",
59
61
  "no-useless-constructor": "error",
@@ -87,10 +89,7 @@ var NeatlintOptionsDefault = {
87
89
  // stylisticTypeChecked but different
88
90
  "@typescript-eslint/consistent-type-exports": "error",
89
91
  "@typescript-eslint/consistent-type-imports": "error",
90
- "@typescript-eslint/explicit-function-return-type": "error",
91
92
  "@typescript-eslint/explicit-member-accessibility": "error",
92
- "@typescript-eslint/no-inferrable-types": "error",
93
- // stylisticTypeChecked
94
93
  "@typescript-eslint/prefer-readonly": "error",
95
94
  "@typescript-eslint/strict-boolean-expressions": "error"
96
95
  }
package/dist/main.mjs CHANGED
@@ -17,7 +17,9 @@ 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"],
22
+ "no-useless-call": "error",
21
23
  "no-useless-computed-key": "error",
22
24
  "no-useless-concat": "error",
23
25
  "no-useless-constructor": "error",
@@ -51,10 +53,7 @@ var NeatlintOptionsDefault = {
51
53
  // stylisticTypeChecked but different
52
54
  "@typescript-eslint/consistent-type-exports": "error",
53
55
  "@typescript-eslint/consistent-type-imports": "error",
54
- "@typescript-eslint/explicit-function-return-type": "error",
55
56
  "@typescript-eslint/explicit-member-accessibility": "error",
56
- "@typescript-eslint/no-inferrable-types": "error",
57
- // stylisticTypeChecked
58
57
  "@typescript-eslint/prefer-readonly": "error",
59
58
  "@typescript-eslint/strict-boolean-expressions": "error"
60
59
  }
@@ -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,9 @@ 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"],
56
+ "no-useless-call": "error",
55
57
  "no-useless-computed-key": "error",
56
58
  "no-useless-concat": "error",
57
59
  "no-useless-constructor": "error",
@@ -85,10 +87,7 @@ var NeatlintOptionsDefault = {
85
87
  // stylisticTypeChecked but different
86
88
  "@typescript-eslint/consistent-type-exports": "error",
87
89
  "@typescript-eslint/consistent-type-imports": "error",
88
- "@typescript-eslint/explicit-function-return-type": "error",
89
90
  "@typescript-eslint/explicit-member-accessibility": "error",
90
- "@typescript-eslint/no-inferrable-types": "error",
91
- // stylisticTypeChecked
92
91
  "@typescript-eslint/prefer-readonly": "error",
93
92
  "@typescript-eslint/strict-boolean-expressions": "error"
94
93
  }
@@ -17,7 +17,9 @@ 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"],
22
+ "no-useless-call": "error",
21
23
  "no-useless-computed-key": "error",
22
24
  "no-useless-concat": "error",
23
25
  "no-useless-constructor": "error",
@@ -51,10 +53,7 @@ var NeatlintOptionsDefault = {
51
53
  // stylisticTypeChecked but different
52
54
  "@typescript-eslint/consistent-type-exports": "error",
53
55
  "@typescript-eslint/consistent-type-imports": "error",
54
- "@typescript-eslint/explicit-function-return-type": "error",
55
56
  "@typescript-eslint/explicit-member-accessibility": "error",
56
- "@typescript-eslint/no-inferrable-types": "error",
57
- // stylisticTypeChecked
58
57
  "@typescript-eslint/prefer-readonly": "error",
59
58
  "@typescript-eslint/strict-boolean-expressions": "error"
60
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neatlint",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "Strict ESLint presets for modern TypeScript projects.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/keift/neatlint",
@@ -17,10 +17,11 @@
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",