neatlint 1.0.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.md +9 -0
- package/README.md +231 -0
- package/dist/barrels/Types.barrel.d.mts +1 -0
- package/dist/barrels/Types.barrel.d.ts +1 -0
- package/dist/barrels/Types.barrel.js +18 -0
- package/dist/barrels/Types.barrel.mjs +0 -0
- package/dist/defaults/NeatlintOptions.default.d.mts +5 -0
- package/dist/defaults/NeatlintOptions.default.d.ts +5 -0
- package/dist/defaults/NeatlintOptions.default.js +93 -0
- package/dist/defaults/NeatlintOptions.default.mjs +58 -0
- package/dist/main.d.mts +2 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +120 -0
- package/dist/main.mjs +83 -0
- package/dist/types/NeatlintOptions.type.d.mts +17 -0
- package/dist/types/NeatlintOptions.type.d.ts +17 -0
- package/dist/types/NeatlintOptions.type.js +18 -0
- package/dist/types/NeatlintOptions.type.mjs +0 -0
- package/dist/utils/Neatlint.util.d.mts +5 -0
- package/dist/utils/Neatlint.util.d.ts +5 -0
- package/dist/utils/Neatlint.util.js +118 -0
- package/dist/utils/Neatlint.util.mjs +83 -0
- package/package.json +36 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Keift
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
[String]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
2
|
+
[Number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
3
|
+
[Boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
4
|
+
[Date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
|
|
5
|
+
[Object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
6
|
+
[Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
7
|
+
[Buffer]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer
|
|
8
|
+
[Function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function
|
|
9
|
+
[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
10
|
+
[Void]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined
|
|
11
|
+
[NeatlintOptionsDefault]: https://github.com/keift/neatlint/blob/main/src/defaults/NeatlintOptions.default.ts
|
|
12
|
+
[NeatlintOptions]: https://github.com/keift/neatlint/blob/main/src/types/NeatlintOptions.type.ts
|
|
13
|
+
|
|
14
|
+
<div align="center">
|
|
15
|
+
<br/>
|
|
16
|
+
<img src="https://i.ibb.co/KpF1K8Zq/unknown.png" width="450px"/>
|
|
17
|
+
<br/>
|
|
18
|
+
<br/>
|
|
19
|
+
<img src="https://img.shields.io/npm/v/neatlint?label=version&color=%23633BFF"/>
|
|
20
|
+
<img src="https://img.shields.io/npm/l/neatlint?label=license&color=%23633BFF"/>
|
|
21
|
+
<img src="https://img.shields.io/npm/dt/neatlint?label=downloads&color=%2300927F"/>
|
|
22
|
+
<img src="https://img.shields.io/npm/unpacked-size/neatlint?label=size&color=%2300927F"/>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
## Contents
|
|
26
|
+
|
|
27
|
+
- [About](#about)
|
|
28
|
+
- [Features](#features)
|
|
29
|
+
- [Installation](#installation)
|
|
30
|
+
- [Documentation](#documentation)
|
|
31
|
+
- [Tree](#tree)
|
|
32
|
+
- [Import](#import)
|
|
33
|
+
- [Methods](#methods)
|
|
34
|
+
- [Recommended use](#recommended-use)
|
|
35
|
+
- [What does it do?](#what-does-it-do)
|
|
36
|
+
- [Types](#types)
|
|
37
|
+
- [Links](#links)
|
|
38
|
+
- [Discord](https://discord.gg/keift)
|
|
39
|
+
- [Telegram](https://t.me/keiftt)
|
|
40
|
+
- [Twitter](https://x.com/keiftttt)
|
|
41
|
+
- [GitHub](https://github.com/keift)
|
|
42
|
+
- [License](#license)
|
|
43
|
+
|
|
44
|
+
## About
|
|
45
|
+
|
|
46
|
+
Strict ESLint presets for modern TypeScript projects.
|
|
47
|
+
|
|
48
|
+
## Features
|
|
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
|
+
- Use of `var` is prohibited and it warns against using `const` and `let` when necessary
|
|
57
|
+
- Unnecessary quotes are prevented on objects, requiring the use of double or single quotes
|
|
58
|
+
- ... and more!
|
|
59
|
+
|
|
60
|
+
## Installation
|
|
61
|
+
|
|
62
|
+
You can install it as follows.
|
|
63
|
+
|
|
64
|
+
```shell
|
|
65
|
+
// NPM
|
|
66
|
+
npm install neatlint
|
|
67
|
+
|
|
68
|
+
// PNPM
|
|
69
|
+
pnpm install neatlint
|
|
70
|
+
|
|
71
|
+
// Yarn
|
|
72
|
+
yarn add neatlint
|
|
73
|
+
|
|
74
|
+
// Bun
|
|
75
|
+
bun add neatlint
|
|
76
|
+
|
|
77
|
+
// Deno
|
|
78
|
+
deno install npm:neatlint
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Documentation
|
|
82
|
+
|
|
83
|
+
### Tree
|
|
84
|
+
|
|
85
|
+
Briefly as follows.
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
neatlint
|
|
89
|
+
│
|
|
90
|
+
├── Neatlint(options?)
|
|
91
|
+
│
|
|
92
|
+
└── type Types
|
|
93
|
+
│
|
|
94
|
+
└── NeatlintOptions
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Import
|
|
98
|
+
|
|
99
|
+
Briefly as follows.
|
|
100
|
+
|
|
101
|
+
> **📁 ./eslint.config.ts**
|
|
102
|
+
>
|
|
103
|
+
> ```typescript
|
|
104
|
+
> import { Neatlint } from "neatlint";
|
|
105
|
+
>
|
|
106
|
+
> export default Neatlint();
|
|
107
|
+
> ```
|
|
108
|
+
|
|
109
|
+
### Methods
|
|
110
|
+
|
|
111
|
+
`Neatlint(options?)`
|
|
112
|
+
|
|
113
|
+
Get the ESLint configuration generated by Neatlint.
|
|
114
|
+
|
|
115
|
+
> | Parameter | Default | Description |
|
|
116
|
+
> | --------- | ------------------------ | -------------------------------------------------- |
|
|
117
|
+
> | options | [NeatlintOptionsDefault] | [NeatlintOptions] (optional)<br/>Neatlint options. |
|
|
118
|
+
>
|
|
119
|
+
> returns [Object]
|
|
120
|
+
>
|
|
121
|
+
> Example:
|
|
122
|
+
>
|
|
123
|
+
> ```typescript
|
|
124
|
+
> export default Neatlint();
|
|
125
|
+
> ```
|
|
126
|
+
|
|
127
|
+
### Recommended use
|
|
128
|
+
|
|
129
|
+
Suggested uses are as follows. We recommend using Prettier.
|
|
130
|
+
|
|
131
|
+
> **📁 ./eslint.config.ts**
|
|
132
|
+
>
|
|
133
|
+
> ```typescript
|
|
134
|
+
> import { Neatlint } from "neatlint";
|
|
135
|
+
>
|
|
136
|
+
> export default Neatlint();
|
|
137
|
+
> ```
|
|
138
|
+
>
|
|
139
|
+
> **📁 ./tsconfig.json**
|
|
140
|
+
>
|
|
141
|
+
> ```json
|
|
142
|
+
> {
|
|
143
|
+
> "compilerOptions": {
|
|
144
|
+
> "strict": true,
|
|
145
|
+
> "esModuleInterop": true,
|
|
146
|
+
>
|
|
147
|
+
> "target": "ES2020",
|
|
148
|
+
> "module": "esnext",
|
|
149
|
+
> "moduleResolution": "bundler",
|
|
150
|
+
> "lib": ["dom", "ES2020"],
|
|
151
|
+
>
|
|
152
|
+
> "typeRoots": ["./types", "./node_modules/@types"]
|
|
153
|
+
> }
|
|
154
|
+
> }
|
|
155
|
+
> ```
|
|
156
|
+
>
|
|
157
|
+
> **📁 ./.prettierrc.json**
|
|
158
|
+
>
|
|
159
|
+
> ```json
|
|
160
|
+
> {
|
|
161
|
+
> "semi": true,
|
|
162
|
+
> "singleQuote": false,
|
|
163
|
+
>
|
|
164
|
+
> "printWidth": 9999,
|
|
165
|
+
> "tabWidth": 2,
|
|
166
|
+
>
|
|
167
|
+
> "trailingComma": "none"
|
|
168
|
+
> }
|
|
169
|
+
> ```
|
|
170
|
+
|
|
171
|
+
### What does it do?
|
|
172
|
+
|
|
173
|
+
Neatlint offers strict ESLint settings.
|
|
174
|
+
|
|
175
|
+
| Rule | Description |
|
|
176
|
+
| -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
177
|
+
| [arrow-body-style](https://eslint.org/docs/latest/rules/arrow-body-style) | Require braces around arrow function bodies. |
|
|
178
|
+
| [comma-dangle](https://eslint.org/docs/latest/rules/comma-dangle) | Require or disallow trailing commas. |
|
|
179
|
+
| [func-style](https://eslint.org/docs/latest/rules/func-style) | Enforce the consistent use of either function declarations or expressions assigned to variables. |
|
|
180
|
+
| [no-duplicate-imports](https://eslint.org/docs/latest/rules/no-duplicate-imports) | Disallow duplicate module imports. |
|
|
181
|
+
| [no-empty](https://eslint.org/docs/latest/rules/no-empty) | Disallow empty block statements. |
|
|
182
|
+
| [no-multi-spaces](https://eslint.org/docs/latest/rules/no-multi-spaces) | Disallow multiple spaces. |
|
|
183
|
+
| [no-multiple-empty-lines](https://eslint.org/docs/latest/rules/no-multiple-empty-lines) | Disallow multiple empty lines. |
|
|
184
|
+
| [no-restricted-syntax](https://eslint.org/docs/latest/rules/no-restricted-syntax) | Disallow specified syntax. |
|
|
185
|
+
| [no-trailing-spaces](https://eslint.org/docs/latest/rules/no-trailing-spaces) | Disallow trailing whitespace at the end of lines. |
|
|
186
|
+
| [no-useless-catch](https://eslint.org/docs/latest/rules/no-useless-catch) | Disallow unnecessary catch clauses. |
|
|
187
|
+
| [no-useless-constructor](https://eslint.org/docs/latest/rules/no-useless-constructor) | Disallow unnecessary constructors. |
|
|
188
|
+
| [no-useless-rename](https://eslint.org/docs/latest/rules/no-useless-rename) | Disallow renaming import, export, and destructured assignments to the same name. |
|
|
189
|
+
| [no-useless-return](https://eslint.org/docs/latest/rules/no-useless-return) | Disallow redundant return statements. |
|
|
190
|
+
| [no-var](https://eslint.org/docs/latest/rules/no-var) | Require let or const instead of var. |
|
|
191
|
+
| [object-shorthand](https://eslint.org/docs/latest/rules/object-shorthand) | Require or disallow method and property shorthand syntax for object literals. |
|
|
192
|
+
| [prefer-arrow-callback](https://eslint.org/docs/latest/rules/prefer-arrow-callback) | Require using arrow functions for callbacks. |
|
|
193
|
+
| [prefer-const](https://eslint.org/docs/latest/rules/prefer-const) | Require const declarations for variables that are never reassigned after declared. |
|
|
194
|
+
| [prefer-template](https://eslint.org/docs/latest/rules/prefer-template) | Require template literals instead of string concatenation. |
|
|
195
|
+
| [quote-props](https://eslint.org/docs/latest/rules/quote-props) | Require quotes around object literal property names. |
|
|
196
|
+
| [eqeqeq](https://eslint.org/docs/latest/rules/eqeqeq) | Require the use of === and !==. |
|
|
197
|
+
| [indent](https://eslint.org/docs/latest/rules/indent) | Enforce consistent indentation. |
|
|
198
|
+
| [quotes](https://eslint.org/docs/latest/rules/quotes) | Enforce the consistent use of either backticks, double, or single quotes. |
|
|
199
|
+
| [@typescript-eslint/consistent-type-definitions](https://typescript-eslint.io/rules/consistent-type-definitions) | Enforce type definitions to consistently use either interface or type. |
|
|
200
|
+
| [@typescript-eslint/consistent-type-exports](https://typescript-eslint.io/rules/consistent-type-exports) | Enforce consistent usage of type exports. |
|
|
201
|
+
| [@typescript-eslint/consistent-type-imports](https://typescript-eslint.io/rules/consistent-type-imports) | Enforce consistent usage of type imports. |
|
|
202
|
+
| [@typescript-eslint/explicit-function-return-type](https://typescript-eslint.io/rules/explicit-function-return-type) | Require explicit return types on functions and class methods. |
|
|
203
|
+
| [@typescript-eslint/explicit-member-accessibility](https://typescript-eslint.io/rules/explicit-member-accessibility) | Require explicit accessibility modifiers on class properties and methods. |
|
|
204
|
+
| [@typescript-eslint/no-inferrable-types](https://typescript-eslint.io/rules/no-inferrable-types) | Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean. |
|
|
205
|
+
| [@typescript-eslint/prefer-readonly](https://typescript-eslint.io/rules/prefer-readonly) | Require private members to be marked as readonly if they're never modified outside of the constructor. |
|
|
206
|
+
| [@typescript-eslint/strict-boolean-expressions](https://typescript-eslint.io/rules/strict-boolean-expressions) | Disallow certain types in boolean expressions. |
|
|
207
|
+
|
|
208
|
+
### Types
|
|
209
|
+
|
|
210
|
+
| Type |
|
|
211
|
+
| ----------------- |
|
|
212
|
+
| [NeatlintOptions] |
|
|
213
|
+
|
|
214
|
+
## Links
|
|
215
|
+
|
|
216
|
+
- [Discord](https://discord.gg/keift)
|
|
217
|
+
- [Telegram](https://t.me/keiftt)
|
|
218
|
+
- [Twitter](https://x.com/keiftttt)
|
|
219
|
+
- [GitHub](https://github.com/keift)
|
|
220
|
+
|
|
221
|
+
## License
|
|
222
|
+
|
|
223
|
+
MIT License
|
|
224
|
+
|
|
225
|
+
Copyright (c) 2025 Keift
|
|
226
|
+
|
|
227
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
228
|
+
|
|
229
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
230
|
+
|
|
231
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NeatlintOptions } from '../types/NeatlintOptions.type.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NeatlintOptions } from '../types/NeatlintOptions.type.js';
|
|
@@ -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/barrels/Types.barrel.ts
|
|
17
|
+
var Types_barrel_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(Types_barrel_exports);
|
|
File without changes
|
|
@@ -0,0 +1,93 @@
|
|
|
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 NeatlintOptionsDefault = {
|
|
38
|
+
ignores: ["./dist/**"],
|
|
39
|
+
typescript_eslint: {
|
|
40
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
41
|
+
languageOptions: {
|
|
42
|
+
parser: import_typescript_eslint.default.parser,
|
|
43
|
+
parserOptions: {
|
|
44
|
+
project: "./tsconfig.json",
|
|
45
|
+
sourceType: "module"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
plugins: {},
|
|
49
|
+
rules: {
|
|
50
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
51
|
+
"@typescript-eslint/consistent-type-exports": "error",
|
|
52
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
53
|
+
"@typescript-eslint/explicit-function-return-type": "error",
|
|
54
|
+
"@typescript-eslint/explicit-member-accessibility": "error",
|
|
55
|
+
"@typescript-eslint/no-inferrable-types": "error",
|
|
56
|
+
"@typescript-eslint/prefer-readonly": "error",
|
|
57
|
+
"@typescript-eslint/strict-boolean-expressions": "error"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
eslint: {
|
|
61
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx", "**/*.mjs", "**/*.cjs"],
|
|
62
|
+
languageOptions: {},
|
|
63
|
+
plugins: {},
|
|
64
|
+
rules: {
|
|
65
|
+
"arrow-body-style": "error",
|
|
66
|
+
"comma-dangle": "error",
|
|
67
|
+
"func-style": ["error", "expression", { allowArrowFunctions: true }],
|
|
68
|
+
"no-duplicate-imports": "error",
|
|
69
|
+
"no-empty": "error",
|
|
70
|
+
"no-multi-spaces": "error",
|
|
71
|
+
"no-multiple-empty-lines": ["error", { max: 1 }],
|
|
72
|
+
"no-restricted-syntax": ["error", "SwitchStatement"],
|
|
73
|
+
"no-trailing-spaces": "error",
|
|
74
|
+
"no-useless-catch": "error",
|
|
75
|
+
"no-useless-constructor": "error",
|
|
76
|
+
"no-useless-rename": "error",
|
|
77
|
+
"no-useless-return": "error",
|
|
78
|
+
"no-var": "error",
|
|
79
|
+
"object-shorthand": "error",
|
|
80
|
+
"prefer-arrow-callback": "error",
|
|
81
|
+
"prefer-const": "error",
|
|
82
|
+
"prefer-template": "error",
|
|
83
|
+
"quote-props": ["error", "as-needed"],
|
|
84
|
+
eqeqeq: "error",
|
|
85
|
+
indent: ["error", 2],
|
|
86
|
+
quotes: ["error", "double"]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
91
|
+
0 && (module.exports = {
|
|
92
|
+
NeatlintOptionsDefault
|
|
93
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// src/defaults/NeatlintOptions.default.ts
|
|
2
|
+
import TSEslint from "typescript-eslint";
|
|
3
|
+
var NeatlintOptionsDefault = {
|
|
4
|
+
ignores: ["./dist/**"],
|
|
5
|
+
typescript_eslint: {
|
|
6
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
7
|
+
languageOptions: {
|
|
8
|
+
parser: TSEslint.parser,
|
|
9
|
+
parserOptions: {
|
|
10
|
+
project: "./tsconfig.json",
|
|
11
|
+
sourceType: "module"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
plugins: {},
|
|
15
|
+
rules: {
|
|
16
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
17
|
+
"@typescript-eslint/consistent-type-exports": "error",
|
|
18
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
19
|
+
"@typescript-eslint/explicit-function-return-type": "error",
|
|
20
|
+
"@typescript-eslint/explicit-member-accessibility": "error",
|
|
21
|
+
"@typescript-eslint/no-inferrable-types": "error",
|
|
22
|
+
"@typescript-eslint/prefer-readonly": "error",
|
|
23
|
+
"@typescript-eslint/strict-boolean-expressions": "error"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
eslint: {
|
|
27
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx", "**/*.mjs", "**/*.cjs"],
|
|
28
|
+
languageOptions: {},
|
|
29
|
+
plugins: {},
|
|
30
|
+
rules: {
|
|
31
|
+
"arrow-body-style": "error",
|
|
32
|
+
"comma-dangle": "error",
|
|
33
|
+
"func-style": ["error", "expression", { allowArrowFunctions: true }],
|
|
34
|
+
"no-duplicate-imports": "error",
|
|
35
|
+
"no-empty": "error",
|
|
36
|
+
"no-multi-spaces": "error",
|
|
37
|
+
"no-multiple-empty-lines": ["error", { max: 1 }],
|
|
38
|
+
"no-restricted-syntax": ["error", "SwitchStatement"],
|
|
39
|
+
"no-trailing-spaces": "error",
|
|
40
|
+
"no-useless-catch": "error",
|
|
41
|
+
"no-useless-constructor": "error",
|
|
42
|
+
"no-useless-rename": "error",
|
|
43
|
+
"no-useless-return": "error",
|
|
44
|
+
"no-var": "error",
|
|
45
|
+
"object-shorthand": "error",
|
|
46
|
+
"prefer-arrow-callback": "error",
|
|
47
|
+
"prefer-const": "error",
|
|
48
|
+
"prefer-template": "error",
|
|
49
|
+
"quote-props": ["error", "as-needed"],
|
|
50
|
+
eqeqeq: "error",
|
|
51
|
+
indent: ["error", 2],
|
|
52
|
+
quotes: ["error", "double"]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
NeatlintOptionsDefault
|
|
58
|
+
};
|
package/dist/main.d.mts
ADDED
package/dist/main.d.ts
ADDED
package/dist/main.js
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
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/main.ts
|
|
31
|
+
var main_exports = {};
|
|
32
|
+
__export(main_exports, {
|
|
33
|
+
Neatlint: () => Neatlint
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(main_exports);
|
|
36
|
+
|
|
37
|
+
// src/utils/Neatlint.util.ts
|
|
38
|
+
var import_typescript_eslint2 = __toESM(require("typescript-eslint"));
|
|
39
|
+
var import_lodash = __toESM(require("lodash"));
|
|
40
|
+
|
|
41
|
+
// src/defaults/NeatlintOptions.default.ts
|
|
42
|
+
var import_typescript_eslint = __toESM(require("typescript-eslint"));
|
|
43
|
+
var NeatlintOptionsDefault = {
|
|
44
|
+
ignores: ["./dist/**"],
|
|
45
|
+
typescript_eslint: {
|
|
46
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
47
|
+
languageOptions: {
|
|
48
|
+
parser: import_typescript_eslint.default.parser,
|
|
49
|
+
parserOptions: {
|
|
50
|
+
project: "./tsconfig.json",
|
|
51
|
+
sourceType: "module"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
plugins: {},
|
|
55
|
+
rules: {
|
|
56
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
57
|
+
"@typescript-eslint/consistent-type-exports": "error",
|
|
58
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
59
|
+
"@typescript-eslint/explicit-function-return-type": "error",
|
|
60
|
+
"@typescript-eslint/explicit-member-accessibility": "error",
|
|
61
|
+
"@typescript-eslint/no-inferrable-types": "error",
|
|
62
|
+
"@typescript-eslint/prefer-readonly": "error",
|
|
63
|
+
"@typescript-eslint/strict-boolean-expressions": "error"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
eslint: {
|
|
67
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx", "**/*.mjs", "**/*.cjs"],
|
|
68
|
+
languageOptions: {},
|
|
69
|
+
plugins: {},
|
|
70
|
+
rules: {
|
|
71
|
+
"arrow-body-style": "error",
|
|
72
|
+
"comma-dangle": "error",
|
|
73
|
+
"func-style": ["error", "expression", { allowArrowFunctions: true }],
|
|
74
|
+
"no-duplicate-imports": "error",
|
|
75
|
+
"no-empty": "error",
|
|
76
|
+
"no-multi-spaces": "error",
|
|
77
|
+
"no-multiple-empty-lines": ["error", { max: 1 }],
|
|
78
|
+
"no-restricted-syntax": ["error", "SwitchStatement"],
|
|
79
|
+
"no-trailing-spaces": "error",
|
|
80
|
+
"no-useless-catch": "error",
|
|
81
|
+
"no-useless-constructor": "error",
|
|
82
|
+
"no-useless-rename": "error",
|
|
83
|
+
"no-useless-return": "error",
|
|
84
|
+
"no-var": "error",
|
|
85
|
+
"object-shorthand": "error",
|
|
86
|
+
"prefer-arrow-callback": "error",
|
|
87
|
+
"prefer-const": "error",
|
|
88
|
+
"prefer-template": "error",
|
|
89
|
+
"quote-props": ["error", "as-needed"],
|
|
90
|
+
eqeqeq: "error",
|
|
91
|
+
indent: ["error", 2],
|
|
92
|
+
quotes: ["error", "double"]
|
|
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
|
+
...import_typescript_eslint2.default.configs.strict,
|
|
103
|
+
{
|
|
104
|
+
files: options.typescript_eslint.files,
|
|
105
|
+
languageOptions: options.typescript_eslint.languageOptions,
|
|
106
|
+
plugins: options.typescript_eslint.plugins,
|
|
107
|
+
rules: options.typescript_eslint.rules
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
files: options.eslint.files,
|
|
111
|
+
languageOptions: options.eslint.languageOptions,
|
|
112
|
+
plugins: options.eslint.plugins,
|
|
113
|
+
rules: options.eslint.rules
|
|
114
|
+
}
|
|
115
|
+
];
|
|
116
|
+
};
|
|
117
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
118
|
+
0 && (module.exports = {
|
|
119
|
+
Neatlint
|
|
120
|
+
});
|
package/dist/main.mjs
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// src/utils/Neatlint.util.ts
|
|
2
|
+
import TSEslint2 from "typescript-eslint";
|
|
3
|
+
import _ from "lodash";
|
|
4
|
+
|
|
5
|
+
// src/defaults/NeatlintOptions.default.ts
|
|
6
|
+
import TSEslint from "typescript-eslint";
|
|
7
|
+
var NeatlintOptionsDefault = {
|
|
8
|
+
ignores: ["./dist/**"],
|
|
9
|
+
typescript_eslint: {
|
|
10
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
11
|
+
languageOptions: {
|
|
12
|
+
parser: TSEslint.parser,
|
|
13
|
+
parserOptions: {
|
|
14
|
+
project: "./tsconfig.json",
|
|
15
|
+
sourceType: "module"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
plugins: {},
|
|
19
|
+
rules: {
|
|
20
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
21
|
+
"@typescript-eslint/consistent-type-exports": "error",
|
|
22
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
23
|
+
"@typescript-eslint/explicit-function-return-type": "error",
|
|
24
|
+
"@typescript-eslint/explicit-member-accessibility": "error",
|
|
25
|
+
"@typescript-eslint/no-inferrable-types": "error",
|
|
26
|
+
"@typescript-eslint/prefer-readonly": "error",
|
|
27
|
+
"@typescript-eslint/strict-boolean-expressions": "error"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
eslint: {
|
|
31
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx", "**/*.mjs", "**/*.cjs"],
|
|
32
|
+
languageOptions: {},
|
|
33
|
+
plugins: {},
|
|
34
|
+
rules: {
|
|
35
|
+
"arrow-body-style": "error",
|
|
36
|
+
"comma-dangle": "error",
|
|
37
|
+
"func-style": ["error", "expression", { allowArrowFunctions: true }],
|
|
38
|
+
"no-duplicate-imports": "error",
|
|
39
|
+
"no-empty": "error",
|
|
40
|
+
"no-multi-spaces": "error",
|
|
41
|
+
"no-multiple-empty-lines": ["error", { max: 1 }],
|
|
42
|
+
"no-restricted-syntax": ["error", "SwitchStatement"],
|
|
43
|
+
"no-trailing-spaces": "error",
|
|
44
|
+
"no-useless-catch": "error",
|
|
45
|
+
"no-useless-constructor": "error",
|
|
46
|
+
"no-useless-rename": "error",
|
|
47
|
+
"no-useless-return": "error",
|
|
48
|
+
"no-var": "error",
|
|
49
|
+
"object-shorthand": "error",
|
|
50
|
+
"prefer-arrow-callback": "error",
|
|
51
|
+
"prefer-const": "error",
|
|
52
|
+
"prefer-template": "error",
|
|
53
|
+
"quote-props": ["error", "as-needed"],
|
|
54
|
+
eqeqeq: "error",
|
|
55
|
+
indent: ["error", 2],
|
|
56
|
+
quotes: ["error", "double"]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// src/utils/Neatlint.util.ts
|
|
62
|
+
var Neatlint = (options = NeatlintOptionsDefault) => {
|
|
63
|
+
options = _.merge({}, NeatlintOptionsDefault, options);
|
|
64
|
+
return [
|
|
65
|
+
{ ignores: options.ignores },
|
|
66
|
+
...TSEslint2.configs.strict,
|
|
67
|
+
{
|
|
68
|
+
files: options.typescript_eslint.files,
|
|
69
|
+
languageOptions: options.typescript_eslint.languageOptions,
|
|
70
|
+
plugins: options.typescript_eslint.plugins,
|
|
71
|
+
rules: options.typescript_eslint.rules
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
files: options.eslint.files,
|
|
75
|
+
languageOptions: options.eslint.languageOptions,
|
|
76
|
+
plugins: options.eslint.plugins,
|
|
77
|
+
rules: options.eslint.rules
|
|
78
|
+
}
|
|
79
|
+
];
|
|
80
|
+
};
|
|
81
|
+
export {
|
|
82
|
+
Neatlint
|
|
83
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type NeatlintOptions = {
|
|
2
|
+
ignores: string[];
|
|
3
|
+
typescript_eslint: {
|
|
4
|
+
files: string[];
|
|
5
|
+
languageOptions: object;
|
|
6
|
+
plugins: Record<string, unknown>;
|
|
7
|
+
rules: Record<string, string | object>;
|
|
8
|
+
};
|
|
9
|
+
eslint: {
|
|
10
|
+
files: string[];
|
|
11
|
+
languageOptions: object;
|
|
12
|
+
plugins: Record<string, unknown>;
|
|
13
|
+
rules: Record<string, string | object>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type { NeatlintOptions };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type NeatlintOptions = {
|
|
2
|
+
ignores: string[];
|
|
3
|
+
typescript_eslint: {
|
|
4
|
+
files: string[];
|
|
5
|
+
languageOptions: object;
|
|
6
|
+
plugins: Record<string, unknown>;
|
|
7
|
+
rules: Record<string, string | object>;
|
|
8
|
+
};
|
|
9
|
+
eslint: {
|
|
10
|
+
files: string[];
|
|
11
|
+
languageOptions: object;
|
|
12
|
+
plugins: Record<string, unknown>;
|
|
13
|
+
rules: Record<string, string | object>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type { NeatlintOptions };
|
|
@@ -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/NeatlintOptions.type.ts
|
|
17
|
+
var NeatlintOptions_type_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(NeatlintOptions_type_exports);
|
|
File without changes
|
|
@@ -0,0 +1,118 @@
|
|
|
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_typescript_eslint2 = __toESM(require("typescript-eslint"));
|
|
37
|
+
var import_lodash = __toESM(require("lodash"));
|
|
38
|
+
|
|
39
|
+
// src/defaults/NeatlintOptions.default.ts
|
|
40
|
+
var import_typescript_eslint = __toESM(require("typescript-eslint"));
|
|
41
|
+
var NeatlintOptionsDefault = {
|
|
42
|
+
ignores: ["./dist/**"],
|
|
43
|
+
typescript_eslint: {
|
|
44
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
45
|
+
languageOptions: {
|
|
46
|
+
parser: import_typescript_eslint.default.parser,
|
|
47
|
+
parserOptions: {
|
|
48
|
+
project: "./tsconfig.json",
|
|
49
|
+
sourceType: "module"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
plugins: {},
|
|
53
|
+
rules: {
|
|
54
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
55
|
+
"@typescript-eslint/consistent-type-exports": "error",
|
|
56
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
57
|
+
"@typescript-eslint/explicit-function-return-type": "error",
|
|
58
|
+
"@typescript-eslint/explicit-member-accessibility": "error",
|
|
59
|
+
"@typescript-eslint/no-inferrable-types": "error",
|
|
60
|
+
"@typescript-eslint/prefer-readonly": "error",
|
|
61
|
+
"@typescript-eslint/strict-boolean-expressions": "error"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
eslint: {
|
|
65
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx", "**/*.mjs", "**/*.cjs"],
|
|
66
|
+
languageOptions: {},
|
|
67
|
+
plugins: {},
|
|
68
|
+
rules: {
|
|
69
|
+
"arrow-body-style": "error",
|
|
70
|
+
"comma-dangle": "error",
|
|
71
|
+
"func-style": ["error", "expression", { allowArrowFunctions: true }],
|
|
72
|
+
"no-duplicate-imports": "error",
|
|
73
|
+
"no-empty": "error",
|
|
74
|
+
"no-multi-spaces": "error",
|
|
75
|
+
"no-multiple-empty-lines": ["error", { max: 1 }],
|
|
76
|
+
"no-restricted-syntax": ["error", "SwitchStatement"],
|
|
77
|
+
"no-trailing-spaces": "error",
|
|
78
|
+
"no-useless-catch": "error",
|
|
79
|
+
"no-useless-constructor": "error",
|
|
80
|
+
"no-useless-rename": "error",
|
|
81
|
+
"no-useless-return": "error",
|
|
82
|
+
"no-var": "error",
|
|
83
|
+
"object-shorthand": "error",
|
|
84
|
+
"prefer-arrow-callback": "error",
|
|
85
|
+
"prefer-const": "error",
|
|
86
|
+
"prefer-template": "error",
|
|
87
|
+
"quote-props": ["error", "as-needed"],
|
|
88
|
+
eqeqeq: "error",
|
|
89
|
+
indent: ["error", 2],
|
|
90
|
+
quotes: ["error", "double"]
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// src/utils/Neatlint.util.ts
|
|
96
|
+
var Neatlint = (options = NeatlintOptionsDefault) => {
|
|
97
|
+
options = import_lodash.default.merge({}, NeatlintOptionsDefault, options);
|
|
98
|
+
return [
|
|
99
|
+
{ ignores: options.ignores },
|
|
100
|
+
...import_typescript_eslint2.default.configs.strict,
|
|
101
|
+
{
|
|
102
|
+
files: options.typescript_eslint.files,
|
|
103
|
+
languageOptions: options.typescript_eslint.languageOptions,
|
|
104
|
+
plugins: options.typescript_eslint.plugins,
|
|
105
|
+
rules: options.typescript_eslint.rules
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
files: options.eslint.files,
|
|
109
|
+
languageOptions: options.eslint.languageOptions,
|
|
110
|
+
plugins: options.eslint.plugins,
|
|
111
|
+
rules: options.eslint.rules
|
|
112
|
+
}
|
|
113
|
+
];
|
|
114
|
+
};
|
|
115
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
116
|
+
0 && (module.exports = {
|
|
117
|
+
Neatlint
|
|
118
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// src/utils/Neatlint.util.ts
|
|
2
|
+
import TSEslint2 from "typescript-eslint";
|
|
3
|
+
import _ from "lodash";
|
|
4
|
+
|
|
5
|
+
// src/defaults/NeatlintOptions.default.ts
|
|
6
|
+
import TSEslint from "typescript-eslint";
|
|
7
|
+
var NeatlintOptionsDefault = {
|
|
8
|
+
ignores: ["./dist/**"],
|
|
9
|
+
typescript_eslint: {
|
|
10
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
11
|
+
languageOptions: {
|
|
12
|
+
parser: TSEslint.parser,
|
|
13
|
+
parserOptions: {
|
|
14
|
+
project: "./tsconfig.json",
|
|
15
|
+
sourceType: "module"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
plugins: {},
|
|
19
|
+
rules: {
|
|
20
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
21
|
+
"@typescript-eslint/consistent-type-exports": "error",
|
|
22
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
23
|
+
"@typescript-eslint/explicit-function-return-type": "error",
|
|
24
|
+
"@typescript-eslint/explicit-member-accessibility": "error",
|
|
25
|
+
"@typescript-eslint/no-inferrable-types": "error",
|
|
26
|
+
"@typescript-eslint/prefer-readonly": "error",
|
|
27
|
+
"@typescript-eslint/strict-boolean-expressions": "error"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
eslint: {
|
|
31
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx", "**/*.mjs", "**/*.cjs"],
|
|
32
|
+
languageOptions: {},
|
|
33
|
+
plugins: {},
|
|
34
|
+
rules: {
|
|
35
|
+
"arrow-body-style": "error",
|
|
36
|
+
"comma-dangle": "error",
|
|
37
|
+
"func-style": ["error", "expression", { allowArrowFunctions: true }],
|
|
38
|
+
"no-duplicate-imports": "error",
|
|
39
|
+
"no-empty": "error",
|
|
40
|
+
"no-multi-spaces": "error",
|
|
41
|
+
"no-multiple-empty-lines": ["error", { max: 1 }],
|
|
42
|
+
"no-restricted-syntax": ["error", "SwitchStatement"],
|
|
43
|
+
"no-trailing-spaces": "error",
|
|
44
|
+
"no-useless-catch": "error",
|
|
45
|
+
"no-useless-constructor": "error",
|
|
46
|
+
"no-useless-rename": "error",
|
|
47
|
+
"no-useless-return": "error",
|
|
48
|
+
"no-var": "error",
|
|
49
|
+
"object-shorthand": "error",
|
|
50
|
+
"prefer-arrow-callback": "error",
|
|
51
|
+
"prefer-const": "error",
|
|
52
|
+
"prefer-template": "error",
|
|
53
|
+
"quote-props": ["error", "as-needed"],
|
|
54
|
+
eqeqeq: "error",
|
|
55
|
+
indent: ["error", 2],
|
|
56
|
+
quotes: ["error", "double"]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// src/utils/Neatlint.util.ts
|
|
62
|
+
var Neatlint = (options = NeatlintOptionsDefault) => {
|
|
63
|
+
options = _.merge({}, NeatlintOptionsDefault, options);
|
|
64
|
+
return [
|
|
65
|
+
{ ignores: options.ignores },
|
|
66
|
+
...TSEslint2.configs.strict,
|
|
67
|
+
{
|
|
68
|
+
files: options.typescript_eslint.files,
|
|
69
|
+
languageOptions: options.typescript_eslint.languageOptions,
|
|
70
|
+
plugins: options.typescript_eslint.plugins,
|
|
71
|
+
rules: options.typescript_eslint.rules
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
files: options.eslint.files,
|
|
75
|
+
languageOptions: options.eslint.languageOptions,
|
|
76
|
+
plugins: options.eslint.plugins,
|
|
77
|
+
rules: options.eslint.rules
|
|
78
|
+
}
|
|
79
|
+
];
|
|
80
|
+
};
|
|
81
|
+
export {
|
|
82
|
+
Neatlint
|
|
83
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "neatlint",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Strict ESLint presets for modern TypeScript projects.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/keift/neatlint",
|
|
7
|
+
"bugs": "https://github.com/keift/neatlint/issues",
|
|
8
|
+
"main": "./dist/main.js",
|
|
9
|
+
"module": "./dist/main.mjs",
|
|
10
|
+
"types": "./dist/main.d.ts",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"tests": "bun run lint && bun test",
|
|
13
|
+
"prettier": "prettier --write ./",
|
|
14
|
+
"build": "tsup",
|
|
15
|
+
"lint": "eslint ./"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@types/lodash": "^4.17.20",
|
|
19
|
+
"jiti": "^2.5.1",
|
|
20
|
+
"lodash": "^4.17.21",
|
|
21
|
+
"typescript": "^5.9.2",
|
|
22
|
+
"typescript-eslint": "^8.42.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"prettier": "^3.6.2",
|
|
26
|
+
"tsup": "^8.5.0"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/keift/neatlint"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"eslint",
|
|
34
|
+
"typescript-eslint"
|
|
35
|
+
]
|
|
36
|
+
}
|