@creo-team/eslint-config 2.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 +15 -0
- package/README.md +189 -0
- package/dist/eslint.config.d.ts +3 -0
- package/dist/eslint.config.d.ts.map +1 -0
- package/dist/eslint.config.js +67 -0
- package/dist/eslint.config.js.map +1 -0
- package/dist/rules.d.ts +298 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +205 -0
- package/dist/rules.js.map +1 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +34 -0
- package/dist/utils.js.map +1 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Krauters
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
|
|
2
|
+
<div align="center">
|
|
3
|
+
|
|
4
|
+
<a href="https://www.linkedin.com/in/coltenkrauter/" target="_blank"><img src="https://img.shields.io/badge/LinkedIn-%230077B5.svg?&style=flat-square&logo=linkedin&logoColor=white" alt="LinkedIn"></a>
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
[](https://www.npmjs.org/package/@krauters/eslint-config)
|
|
10
|
+

|
|
11
|
+

|
|
12
|
+
|
|
13
|
+

|
|
14
|
+

|
|
15
|
+

|
|
16
|
+

|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
[](https://packagephobia.now.sh/result?p=@krauters/eslint-config)
|
|
20
|
+

|
|
21
|
+

|
|
22
|
+
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
# ESLint Config
|
|
26
|
+
|
|
27
|
+
This configuration integrates [ESLint](https://eslint.org/) and [TypeScript ESLint](https://typescript-eslint.io/), built to ensure clean, consistent, and maintainable code in JavaScript and TypeScript projects.
|
|
28
|
+
|
|
29
|
+
## Tenets
|
|
30
|
+
|
|
31
|
+
1. **Feedback Loops**: In DevOps, feedback loops are essential. Realtime linting gives developers instant insight, allowing faster fixes and smoother workflows. So, configure your IDE to provide linting feedback as you type.
|
|
32
|
+
|
|
33
|
+
2. **Code Consistency**: Linting ensures uniform coding standards across the team, reducing errors and enhancing collaboration by maintaining clarity and readability.
|
|
34
|
+
|
|
35
|
+
## Rules
|
|
36
|
+
|
|
37
|
+
All linting rules are defined in [rules.js](./rules.js). This configuration offers a strong foundation suitable for most projects, promoting code quality from the start while remaining flexible for customization.
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
### Commands You Need
|
|
42
|
+
|
|
43
|
+
```zsh
|
|
44
|
+
# Check if your code passes lint rules
|
|
45
|
+
npm run lint
|
|
46
|
+
|
|
47
|
+
# Fix what can be auto-fixed
|
|
48
|
+
npm run fix
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Using this Lint Config in Your Project
|
|
52
|
+
|
|
53
|
+
1. Install the necessary dependencies:
|
|
54
|
+
|
|
55
|
+
```zsh
|
|
56
|
+
npm install @krauters/eslint-config --save-dev
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
1. Add a config file `eslint.config.js` to the root of your project with the following contents,
|
|
60
|
+
|
|
61
|
+
### ESM
|
|
62
|
+
|
|
63
|
+
```javascript
|
|
64
|
+
// eslint.config.js
|
|
65
|
+
|
|
66
|
+
import eslintConfig from '@krauters/eslint-config'
|
|
67
|
+
|
|
68
|
+
export default eslintConfig
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### CommonJS
|
|
72
|
+
|
|
73
|
+
```javascript
|
|
74
|
+
// eslint.config.js
|
|
75
|
+
|
|
76
|
+
const eslintConfig = require('@krauters/eslint-config')
|
|
77
|
+
|
|
78
|
+
module.exports = eslintConfig
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
1. Add these npm scripts to your [package.json](./package.json),
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
...
|
|
86
|
+
"scripts": {
|
|
87
|
+
"test": "npm run lint",
|
|
88
|
+
"lint": "npx eslint src/**",
|
|
89
|
+
"fix": "npm run lint -- --fix"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
1. Update your README to show off your linting setup,
|
|
95
|
+
|
|
96
|
+
````zsh
|
|
97
|
+
## Lint
|
|
98
|
+
This package uses [@krauters/eslint-config](https://github.com/krauters/eslint-config).
|
|
99
|
+
|
|
100
|
+
```zsh
|
|
101
|
+
# Check if your code follows the rules
|
|
102
|
+
npm run lint
|
|
103
|
+
|
|
104
|
+
# Fix what can be auto-fixed
|
|
105
|
+
npm run fix
|
|
106
|
+
```
|
|
107
|
+
````
|
|
108
|
+
|
|
109
|
+
1. Now, let’s try it out.
|
|
110
|
+
|
|
111
|
+
```zsh
|
|
112
|
+
npm run lint
|
|
113
|
+
npm run fix
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Development
|
|
117
|
+
|
|
118
|
+
### Testing Locally
|
|
119
|
+
|
|
120
|
+
Want to test this linting config locally between two repos? Easy.
|
|
121
|
+
|
|
122
|
+
- **Repo1** is the ESLint config repo.
|
|
123
|
+
- **Repo2** is a JS/TS project using Repo1.
|
|
124
|
+
|
|
125
|
+
#### Steps
|
|
126
|
+
|
|
127
|
+
1. Clone both repos.
|
|
128
|
+
2. Link 'em up. From the root of Repo1, run:
|
|
129
|
+
|
|
130
|
+
```zsh
|
|
131
|
+
npm link
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
3. Then in Repo2, do this:
|
|
135
|
+
|
|
136
|
+
```zsh
|
|
137
|
+
npm link @krauters/eslint-config
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
4. When you’re done testing, unlink it with,
|
|
141
|
+
|
|
142
|
+
```zsh
|
|
143
|
+
npm unlink @krauters/eslint-config
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Setting Up Environment Variables
|
|
147
|
+
|
|
148
|
+
To control the behavior of how this package gets it's tsconfig file, you can set the following environment variables:
|
|
149
|
+
|
|
150
|
+
- `ESLINT_DEBUG`: Enables detailed debug logging. Set this to any truthy value, e.g., `1` or `true`.
|
|
151
|
+
- `ESLINT_TSCONFIG`: Overrides the default target file being searched. Defaults to `tsconfig.eslint.json`.
|
|
152
|
+
- `ESLINT_START_DIR`: Specifies the starting directory for the search. Defaults to the current working directory (`process.cwd()`).
|
|
153
|
+
- `ESLINT_TSCONFIG_FALLBACK`: Sets a fallback file to use if the target file is not found. Defaults to `tsconfig.json`.
|
|
154
|
+
|
|
155
|
+
### Debugging Tips
|
|
156
|
+
|
|
157
|
+
To troubleshoot your ESLint configuration, use the following commands:
|
|
158
|
+
|
|
159
|
+
```zsh
|
|
160
|
+
# Print the full ESLint config for a specific file that you want to lint
|
|
161
|
+
npx eslint --print-config test/auth-service.test.ts | grep tsconfig
|
|
162
|
+
|
|
163
|
+
# Enable debug logging while running ESLint
|
|
164
|
+
ESLINT_DEBUG=true npx eslint .
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Resources
|
|
168
|
+
|
|
169
|
+
- [TypeScript ESLint Playground](https://typescript-eslint.io/play)
|
|
170
|
+
|
|
171
|
+
## Contributing
|
|
172
|
+
|
|
173
|
+
The goal of this project is to continually evolve and improve its core features, making it more efficient and easier to use. Development happens openly here on GitHub, and we’re thankful to the community for contributing bug fixes, enhancements, and fresh ideas. Whether you're fixing a small bug or suggesting a major improvement, your input is invaluable.
|
|
174
|
+
|
|
175
|
+
## License
|
|
176
|
+
|
|
177
|
+
This project is licensed under the ISC License. Please see the [LICENSE](./LICENSE) file for more details.
|
|
178
|
+
|
|
179
|
+
## 🥂 Thanks Contributors
|
|
180
|
+
|
|
181
|
+
Thanks for spending time on this project.
|
|
182
|
+
|
|
183
|
+
<a href="https://github.com/krauters/eslint-config/graphs/contributors">
|
|
184
|
+
<img src="https://contrib.rocks/image?repo=krauters/eslint-config" />
|
|
185
|
+
</a>
|
|
186
|
+
|
|
187
|
+
<br />
|
|
188
|
+
<br />
|
|
189
|
+
<a href="https://www.buymeacoffee.com/coltenkrauter"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=coltenkrauter&button_colour=FFDD00&font_colour=```&font_family=Cookie&outline_colour=```&coffee_colour=ffffff" /></a>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../eslint.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const eslint = require('@eslint/js');
|
|
3
|
+
const pluginStylistic = require('@stylistic/eslint-plugin');
|
|
4
|
+
const pluginImport = require('eslint-plugin-import');
|
|
5
|
+
const jsdoc = require('eslint-plugin-jsdoc');
|
|
6
|
+
const perfectionist = require('eslint-plugin-perfectionist');
|
|
7
|
+
const prettier = require('eslint-plugin-prettier');
|
|
8
|
+
const projectStructure = require('eslint-plugin-project-structure');
|
|
9
|
+
const tsEslint = require('typescript-eslint');
|
|
10
|
+
const { rules } = require('./rules.js');
|
|
11
|
+
const { getTsConfigFile } = require('./utils.js');
|
|
12
|
+
const project = getTsConfigFile();
|
|
13
|
+
module.exports = tsEslint.config({ ignores: ['dist/**'] }, eslint.configs.recommended, ...tsEslint.configs.recommendedTypeChecked, ...tsEslint.configs.stylisticTypeChecked, ...tsEslint.configs.strictTypeChecked, perfectionist.configs['recommended-alphabetical'], {
|
|
14
|
+
files: ['*.js', '*.jsx'],
|
|
15
|
+
...tsEslint.configs.disableTypeChecked,
|
|
16
|
+
}, {
|
|
17
|
+
languageOptions: {
|
|
18
|
+
globals: {
|
|
19
|
+
module: 'readonly',
|
|
20
|
+
require: 'readonly',
|
|
21
|
+
},
|
|
22
|
+
parser: tsEslint.parser,
|
|
23
|
+
parserOptions: {
|
|
24
|
+
project,
|
|
25
|
+
sourceType: 'unambiguous',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
plugins: {
|
|
29
|
+
'@stylistic': pluginStylistic,
|
|
30
|
+
import: pluginImport,
|
|
31
|
+
jsdoc,
|
|
32
|
+
prettier,
|
|
33
|
+
'project-structure': projectStructure,
|
|
34
|
+
},
|
|
35
|
+
rules: {
|
|
36
|
+
...rules,
|
|
37
|
+
'@typescript-eslint/no-misused-spread': 'off',
|
|
38
|
+
},
|
|
39
|
+
settings: {
|
|
40
|
+
'import/resolver': {
|
|
41
|
+
typescript: {},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
}, {
|
|
45
|
+
files: ['**/*.tsx'],
|
|
46
|
+
languageOptions: {
|
|
47
|
+
parser: tsEslint.parser,
|
|
48
|
+
parserOptions: {
|
|
49
|
+
project,
|
|
50
|
+
sourceType: 'unambiguous',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
rules: {
|
|
54
|
+
...rules,
|
|
55
|
+
'@typescript-eslint/naming-convention': [
|
|
56
|
+
'error',
|
|
57
|
+
{ format: ['camelCase'], selector: 'default' },
|
|
58
|
+
{ format: ['camelCase', 'PascalCase'], selector: 'import' },
|
|
59
|
+
{ format: ['camelCase', 'PascalCase'], selector: 'variable' },
|
|
60
|
+
{ format: ['PascalCase'], selector: 'typeLike' },
|
|
61
|
+
{ format: ['PascalCase'], selector: 'enumMember' },
|
|
62
|
+
],
|
|
63
|
+
'@typescript-eslint/no-misused-spread': 'off',
|
|
64
|
+
'@typescript-eslint/no-unsafe-return': 'off',
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=eslint.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.config.js","sourceRoot":"","sources":["../eslint.config.js"],"names":[],"mappings":";AAEA,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;AACpC,MAAM,eAAe,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AAC3D,MAAM,YAAY,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;AACpD,MAAM,KAAK,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAC5C,MAAM,aAAa,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAA;AAC5D,MAAM,QAAQ,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAA;AAClD,MAAM,gBAAgB,GAAG,OAAO,CAAC,iCAAiC,CAAC,CAAA;AACnE,MAAM,QAAQ,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AAE7C,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;AACvC,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;AAEjD,MAAM,OAAO,GAAG,eAAe,EAAE,CAAA;AAEjC,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC,MAAM,CAC/B,EAAE,OAAO,EAAE,CAAC,SAAS,CAA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E,QAAQ,EAAE,UAAU,EAAE;YAC7D,EAAE,MAAM,EAAE,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE;YAChD,EAAE,MAAM,EAAE,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE;SAClD;QACD,sCAAsC,EAAE,KAAK;QAC7C,qCAAqC,EAAE,KAAK;KAC5C;CACD,CACD,CAAA"}
|
package/dist/rules.d.ts
ADDED
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
export const commonjsPreventRules: {
|
|
2
|
+
'@typescript-eslint/no-require-imports': string;
|
|
3
|
+
'import/no-amd': string;
|
|
4
|
+
'import/no-commonjs': string;
|
|
5
|
+
'import/no-default-export': string;
|
|
6
|
+
};
|
|
7
|
+
export const jsDoc: {
|
|
8
|
+
'jsdoc/require-description-complete-sentence': string;
|
|
9
|
+
'jsdoc/require-hyphen-before-param-description': string;
|
|
10
|
+
'jsdoc/require-jsdoc': (string | {
|
|
11
|
+
require: {
|
|
12
|
+
ArrowFunctionExpression: boolean;
|
|
13
|
+
ClassDeclaration: boolean;
|
|
14
|
+
ClassExpression: boolean;
|
|
15
|
+
FunctionDeclaration: boolean;
|
|
16
|
+
FunctionExpression: boolean;
|
|
17
|
+
MethodDefinition: boolean;
|
|
18
|
+
};
|
|
19
|
+
})[];
|
|
20
|
+
'jsdoc/require-param': string;
|
|
21
|
+
'jsdoc/require-param-description': string;
|
|
22
|
+
'jsdoc/require-param-name': string;
|
|
23
|
+
'jsdoc/require-property': string;
|
|
24
|
+
'jsdoc/require-property-description': string;
|
|
25
|
+
'jsdoc/require-property-name': string;
|
|
26
|
+
'jsdoc/require-returns': string;
|
|
27
|
+
'jsdoc/require-yields': string;
|
|
28
|
+
};
|
|
29
|
+
export const prettier: {
|
|
30
|
+
'@stylistic/indent': string;
|
|
31
|
+
'@stylistic/quotes': string;
|
|
32
|
+
'@stylistic/space-before-function-paren': string;
|
|
33
|
+
'max-len': string;
|
|
34
|
+
'prettier/prettier': (string | {
|
|
35
|
+
arrowParens: string;
|
|
36
|
+
bracketSameLine: boolean;
|
|
37
|
+
bracketSpacing: boolean;
|
|
38
|
+
jsxSingleQuote: boolean;
|
|
39
|
+
printWidth: number;
|
|
40
|
+
quoteProps: string;
|
|
41
|
+
semi: boolean;
|
|
42
|
+
singleQuote: boolean;
|
|
43
|
+
tabWidth: number;
|
|
44
|
+
trailingComma: string;
|
|
45
|
+
useTabs: boolean;
|
|
46
|
+
})[];
|
|
47
|
+
};
|
|
48
|
+
export const rules: {
|
|
49
|
+
'perfectionist/sort-imports': string;
|
|
50
|
+
'@typescript-eslint/array-type': string;
|
|
51
|
+
'@typescript-eslint/consistent-indexed-object-style': string;
|
|
52
|
+
'@typescript-eslint/consistent-type-assertions': string;
|
|
53
|
+
'@typescript-eslint/consistent-type-definitions': string;
|
|
54
|
+
'@typescript-eslint/consistent-type-exports': string;
|
|
55
|
+
'@typescript-eslint/consistent-type-imports': string;
|
|
56
|
+
'@typescript-eslint/dot-notation': string;
|
|
57
|
+
'@typescript-eslint/naming-convention': (string | {
|
|
58
|
+
format: string[];
|
|
59
|
+
selector: string;
|
|
60
|
+
})[];
|
|
61
|
+
'@typescript-eslint/no-explicit-any': string;
|
|
62
|
+
'@typescript-eslint/no-extraneous-class': string;
|
|
63
|
+
'@typescript-eslint/no-restricted-imports': string;
|
|
64
|
+
'@typescript-eslint/no-restricted-types': string;
|
|
65
|
+
'@typescript-eslint/no-unnecessary-condition': string;
|
|
66
|
+
'@typescript-eslint/no-unsafe-argument': string;
|
|
67
|
+
'@typescript-eslint/no-unsafe-assignment': string;
|
|
68
|
+
'@typescript-eslint/no-unsafe-call': string;
|
|
69
|
+
'@typescript-eslint/no-unsafe-member-access': string;
|
|
70
|
+
'@typescript-eslint/no-unsafe-return': string;
|
|
71
|
+
'@typescript-eslint/restrict-template-expressions': string;
|
|
72
|
+
'@typescript-eslint/unbound-method': string;
|
|
73
|
+
'dot-notation': string;
|
|
74
|
+
'eol-last': string[];
|
|
75
|
+
'import/first': string;
|
|
76
|
+
'import/named': string;
|
|
77
|
+
'import/newline-after-import': (string | {
|
|
78
|
+
count: number;
|
|
79
|
+
})[];
|
|
80
|
+
'import/no-absolute-path': string;
|
|
81
|
+
'import/no-cycle': string;
|
|
82
|
+
'import/no-duplicates': string;
|
|
83
|
+
'import/no-empty-named-blocks': string;
|
|
84
|
+
'import/no-relative-packages': string;
|
|
85
|
+
'import/no-self-import': string;
|
|
86
|
+
'import/no-unresolved': string;
|
|
87
|
+
'import/no-unused-modules': string;
|
|
88
|
+
'import/no-useless-path-segments': string;
|
|
89
|
+
'import/prefer-default-export': string;
|
|
90
|
+
'max-classes-per-file': (string | {
|
|
91
|
+
ignoreExpressions: boolean;
|
|
92
|
+
max: number;
|
|
93
|
+
})[];
|
|
94
|
+
'max-lines': (string | {
|
|
95
|
+
max: number;
|
|
96
|
+
skipBlankLines: boolean;
|
|
97
|
+
skipComments: boolean;
|
|
98
|
+
})[];
|
|
99
|
+
'max-lines-per-function': (string | number)[];
|
|
100
|
+
'newline-before-return': string;
|
|
101
|
+
'no-inline-comments': string;
|
|
102
|
+
'no-mixed-spaces-and-tabs': string;
|
|
103
|
+
'no-multiple-empty-lines': (string | {
|
|
104
|
+
max: number;
|
|
105
|
+
})[];
|
|
106
|
+
'no-restricted-imports': string;
|
|
107
|
+
'no-unsafe-member-access': string;
|
|
108
|
+
'object-curly-newline': string;
|
|
109
|
+
'spaced-comment': (string | {
|
|
110
|
+
block: {
|
|
111
|
+
balanced: boolean;
|
|
112
|
+
};
|
|
113
|
+
})[];
|
|
114
|
+
'@stylistic/block-spacing': string[];
|
|
115
|
+
'@stylistic/brace-style': string[];
|
|
116
|
+
'@stylistic/comma-dangle': string[];
|
|
117
|
+
'@stylistic/comma-spacing': (string | {
|
|
118
|
+
before: boolean;
|
|
119
|
+
})[];
|
|
120
|
+
'@stylistic/function-call-spacing': string[];
|
|
121
|
+
'@stylistic/key-spacing': (string | {
|
|
122
|
+
afterColon: boolean;
|
|
123
|
+
beforeColon: boolean;
|
|
124
|
+
})[];
|
|
125
|
+
'@stylistic/keyword-spacing': (string | {
|
|
126
|
+
after: boolean;
|
|
127
|
+
before: boolean;
|
|
128
|
+
})[];
|
|
129
|
+
'@stylistic/lines-around-comment': (string | {
|
|
130
|
+
allowArrayStart: boolean;
|
|
131
|
+
allowBlockStart: boolean;
|
|
132
|
+
allowClassStart: boolean;
|
|
133
|
+
allowObjectStart: boolean;
|
|
134
|
+
applyDefaultIgnorePatterns: boolean;
|
|
135
|
+
beforeBlockComment: boolean;
|
|
136
|
+
beforeLineComment: boolean;
|
|
137
|
+
})[];
|
|
138
|
+
'@stylistic/lines-between-class-members': (string | {
|
|
139
|
+
enforce: {
|
|
140
|
+
blankLine: string;
|
|
141
|
+
next: string;
|
|
142
|
+
prev: string;
|
|
143
|
+
}[];
|
|
144
|
+
exceptAfterSingleLine?: undefined;
|
|
145
|
+
} | {
|
|
146
|
+
exceptAfterSingleLine: boolean;
|
|
147
|
+
enforce?: undefined;
|
|
148
|
+
})[];
|
|
149
|
+
'@stylistic/member-delimiter-style': (string | {
|
|
150
|
+
multiline: {
|
|
151
|
+
delimiter: string;
|
|
152
|
+
};
|
|
153
|
+
})[];
|
|
154
|
+
'@stylistic/no-extra-parens': string[];
|
|
155
|
+
'@stylistic/padding-line-between-statements': string;
|
|
156
|
+
'@stylistic/quote-props': string[];
|
|
157
|
+
'@stylistic/semi': string[];
|
|
158
|
+
'@stylistic/space-before-blocks': string[];
|
|
159
|
+
'@stylistic/space-infix-ops': string;
|
|
160
|
+
'@stylistic/type-annotation-spacing': string;
|
|
161
|
+
'@stylistic/indent': string;
|
|
162
|
+
'@stylistic/quotes': string;
|
|
163
|
+
'@stylistic/space-before-function-paren': string;
|
|
164
|
+
'max-len': string;
|
|
165
|
+
'prettier/prettier': (string | {
|
|
166
|
+
arrowParens: string;
|
|
167
|
+
bracketSameLine: boolean;
|
|
168
|
+
bracketSpacing: boolean;
|
|
169
|
+
jsxSingleQuote: boolean;
|
|
170
|
+
printWidth: number;
|
|
171
|
+
quoteProps: string;
|
|
172
|
+
semi: boolean;
|
|
173
|
+
singleQuote: boolean;
|
|
174
|
+
tabWidth: number;
|
|
175
|
+
trailingComma: string;
|
|
176
|
+
useTabs: boolean;
|
|
177
|
+
})[];
|
|
178
|
+
'@typescript-eslint/no-require-imports': string;
|
|
179
|
+
'import/no-amd': string;
|
|
180
|
+
'import/no-commonjs': string;
|
|
181
|
+
'import/no-default-export': string;
|
|
182
|
+
};
|
|
183
|
+
export const stylisticTs: {
|
|
184
|
+
'@stylistic/block-spacing': string[];
|
|
185
|
+
'@stylistic/brace-style': string[];
|
|
186
|
+
'@stylistic/comma-dangle': string[];
|
|
187
|
+
'@stylistic/comma-spacing': (string | {
|
|
188
|
+
before: boolean;
|
|
189
|
+
})[];
|
|
190
|
+
'@stylistic/function-call-spacing': string[];
|
|
191
|
+
'@stylistic/key-spacing': (string | {
|
|
192
|
+
afterColon: boolean;
|
|
193
|
+
beforeColon: boolean;
|
|
194
|
+
})[];
|
|
195
|
+
'@stylistic/keyword-spacing': (string | {
|
|
196
|
+
after: boolean;
|
|
197
|
+
before: boolean;
|
|
198
|
+
})[];
|
|
199
|
+
'@stylistic/lines-around-comment': (string | {
|
|
200
|
+
allowArrayStart: boolean;
|
|
201
|
+
allowBlockStart: boolean;
|
|
202
|
+
allowClassStart: boolean;
|
|
203
|
+
allowObjectStart: boolean;
|
|
204
|
+
applyDefaultIgnorePatterns: boolean;
|
|
205
|
+
beforeBlockComment: boolean;
|
|
206
|
+
beforeLineComment: boolean;
|
|
207
|
+
})[];
|
|
208
|
+
'@stylistic/lines-between-class-members': (string | {
|
|
209
|
+
enforce: {
|
|
210
|
+
blankLine: string;
|
|
211
|
+
next: string;
|
|
212
|
+
prev: string;
|
|
213
|
+
}[];
|
|
214
|
+
exceptAfterSingleLine?: undefined;
|
|
215
|
+
} | {
|
|
216
|
+
exceptAfterSingleLine: boolean;
|
|
217
|
+
enforce?: undefined;
|
|
218
|
+
})[];
|
|
219
|
+
'@stylistic/member-delimiter-style': (string | {
|
|
220
|
+
multiline: {
|
|
221
|
+
delimiter: string;
|
|
222
|
+
};
|
|
223
|
+
})[];
|
|
224
|
+
'@stylistic/no-extra-parens': string[];
|
|
225
|
+
'@stylistic/padding-line-between-statements': string;
|
|
226
|
+
'@stylistic/quote-props': string[];
|
|
227
|
+
'@stylistic/semi': string[];
|
|
228
|
+
'@stylistic/space-before-blocks': string[];
|
|
229
|
+
'@stylistic/space-infix-ops': string;
|
|
230
|
+
'@stylistic/type-annotation-spacing': string;
|
|
231
|
+
};
|
|
232
|
+
export const tsEslint: {
|
|
233
|
+
'@typescript-eslint/array-type': string;
|
|
234
|
+
'@typescript-eslint/consistent-indexed-object-style': string;
|
|
235
|
+
'@typescript-eslint/consistent-type-assertions': string;
|
|
236
|
+
'@typescript-eslint/consistent-type-definitions': string;
|
|
237
|
+
'@typescript-eslint/consistent-type-exports': string;
|
|
238
|
+
'@typescript-eslint/consistent-type-imports': string;
|
|
239
|
+
'@typescript-eslint/dot-notation': string;
|
|
240
|
+
'@typescript-eslint/naming-convention': (string | {
|
|
241
|
+
format: string[];
|
|
242
|
+
selector: string;
|
|
243
|
+
})[];
|
|
244
|
+
'@typescript-eslint/no-explicit-any': string;
|
|
245
|
+
'@typescript-eslint/no-extraneous-class': string;
|
|
246
|
+
'@typescript-eslint/no-restricted-imports': string;
|
|
247
|
+
'@typescript-eslint/no-restricted-types': string;
|
|
248
|
+
'@typescript-eslint/no-unnecessary-condition': string;
|
|
249
|
+
'@typescript-eslint/no-unsafe-argument': string;
|
|
250
|
+
'@typescript-eslint/no-unsafe-assignment': string;
|
|
251
|
+
'@typescript-eslint/no-unsafe-call': string;
|
|
252
|
+
'@typescript-eslint/no-unsafe-member-access': string;
|
|
253
|
+
'@typescript-eslint/no-unsafe-return': string;
|
|
254
|
+
'@typescript-eslint/restrict-template-expressions': string;
|
|
255
|
+
'@typescript-eslint/unbound-method': string;
|
|
256
|
+
'dot-notation': string;
|
|
257
|
+
'eol-last': string[];
|
|
258
|
+
'import/first': string;
|
|
259
|
+
'import/named': string;
|
|
260
|
+
'import/newline-after-import': (string | {
|
|
261
|
+
count: number;
|
|
262
|
+
})[];
|
|
263
|
+
'import/no-absolute-path': string;
|
|
264
|
+
'import/no-cycle': string;
|
|
265
|
+
'import/no-duplicates': string;
|
|
266
|
+
'import/no-empty-named-blocks': string;
|
|
267
|
+
'import/no-relative-packages': string;
|
|
268
|
+
'import/no-self-import': string;
|
|
269
|
+
'import/no-unresolved': string;
|
|
270
|
+
'import/no-unused-modules': string;
|
|
271
|
+
'import/no-useless-path-segments': string;
|
|
272
|
+
'import/prefer-default-export': string;
|
|
273
|
+
'max-classes-per-file': (string | {
|
|
274
|
+
ignoreExpressions: boolean;
|
|
275
|
+
max: number;
|
|
276
|
+
})[];
|
|
277
|
+
'max-lines': (string | {
|
|
278
|
+
max: number;
|
|
279
|
+
skipBlankLines: boolean;
|
|
280
|
+
skipComments: boolean;
|
|
281
|
+
})[];
|
|
282
|
+
'max-lines-per-function': (string | number)[];
|
|
283
|
+
'newline-before-return': string;
|
|
284
|
+
'no-inline-comments': string;
|
|
285
|
+
'no-mixed-spaces-and-tabs': string;
|
|
286
|
+
'no-multiple-empty-lines': (string | {
|
|
287
|
+
max: number;
|
|
288
|
+
})[];
|
|
289
|
+
'no-restricted-imports': string;
|
|
290
|
+
'no-unsafe-member-access': string;
|
|
291
|
+
'object-curly-newline': string;
|
|
292
|
+
'spaced-comment': (string | {
|
|
293
|
+
block: {
|
|
294
|
+
balanced: boolean;
|
|
295
|
+
};
|
|
296
|
+
})[];
|
|
297
|
+
};
|
|
298
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../rules.js"],"names":[],"mappings":"AAmNA;;;;;EAKC;AA3LD;;;;;;;;;;;;;;;;;;;;;EAwBC;AAMD;;;;;;;;;;;;;;;;;;EAqBC;AAiJD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMC;AAhJD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDC;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyDC"}
|
package/dist/rules.js
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const { all, always, error, never, none, off } = {
|
|
3
|
+
all: 'all',
|
|
4
|
+
always: 'always',
|
|
5
|
+
error: 'error',
|
|
6
|
+
never: 'never',
|
|
7
|
+
none: 'none',
|
|
8
|
+
off: 'off',
|
|
9
|
+
};
|
|
10
|
+
const { camelCase, pascalCase } = {
|
|
11
|
+
camelCase: 'camelCase',
|
|
12
|
+
kebabCase: 'kebab',
|
|
13
|
+
pascalCase: 'PascalCase',
|
|
14
|
+
};
|
|
15
|
+
const maxClasses = 1;
|
|
16
|
+
const maxLinesPerFile = 400;
|
|
17
|
+
const maxLinesPerFunction = 200;
|
|
18
|
+
const maxConsecutiveEmptyLines = 1;
|
|
19
|
+
const printWidth = 120;
|
|
20
|
+
const tabWidth = 4;
|
|
21
|
+
const newlineCount = 1;
|
|
22
|
+
const jsDoc = {
|
|
23
|
+
'jsdoc/require-description-complete-sentence': error,
|
|
24
|
+
'jsdoc/require-hyphen-before-param-description': error,
|
|
25
|
+
'jsdoc/require-jsdoc': [
|
|
26
|
+
error,
|
|
27
|
+
{
|
|
28
|
+
require: {
|
|
29
|
+
ArrowFunctionExpression: true,
|
|
30
|
+
ClassDeclaration: false,
|
|
31
|
+
ClassExpression: true,
|
|
32
|
+
FunctionDeclaration: true,
|
|
33
|
+
FunctionExpression: true,
|
|
34
|
+
MethodDefinition: true,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
'jsdoc/require-param': error,
|
|
39
|
+
'jsdoc/require-param-description': error,
|
|
40
|
+
'jsdoc/require-param-name': error,
|
|
41
|
+
'jsdoc/require-property': off,
|
|
42
|
+
'jsdoc/require-property-description': off,
|
|
43
|
+
'jsdoc/require-property-name': off,
|
|
44
|
+
'jsdoc/require-returns': error,
|
|
45
|
+
'jsdoc/require-yields': error,
|
|
46
|
+
};
|
|
47
|
+
const prettier = {
|
|
48
|
+
'@stylistic/indent': off,
|
|
49
|
+
'@stylistic/quotes': off,
|
|
50
|
+
'@stylistic/space-before-function-paren': off,
|
|
51
|
+
'max-len': off,
|
|
52
|
+
'prettier/prettier': [
|
|
53
|
+
error,
|
|
54
|
+
{
|
|
55
|
+
arrowParens: always,
|
|
56
|
+
bracketSameLine: false,
|
|
57
|
+
bracketSpacing: true,
|
|
58
|
+
jsxSingleQuote: false,
|
|
59
|
+
printWidth,
|
|
60
|
+
quoteProps: 'as-needed',
|
|
61
|
+
semi: false,
|
|
62
|
+
singleQuote: true,
|
|
63
|
+
tabWidth,
|
|
64
|
+
trailingComma: all,
|
|
65
|
+
useTabs: true,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
const stylisticTs = {
|
|
70
|
+
'@stylistic/block-spacing': [error, always],
|
|
71
|
+
'@stylistic/brace-style': [error, '1tbs'],
|
|
72
|
+
'@stylistic/comma-dangle': [error, 'always-multiline'],
|
|
73
|
+
'@stylistic/comma-spacing': [error, { before: false }],
|
|
74
|
+
'@stylistic/function-call-spacing': [error, never],
|
|
75
|
+
'@stylistic/key-spacing': [
|
|
76
|
+
error,
|
|
77
|
+
{
|
|
78
|
+
afterColon: true,
|
|
79
|
+
beforeColon: false,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
'@stylistic/keyword-spacing': [
|
|
83
|
+
error,
|
|
84
|
+
{
|
|
85
|
+
after: true,
|
|
86
|
+
before: true,
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
'@stylistic/lines-around-comment': [
|
|
90
|
+
error,
|
|
91
|
+
{
|
|
92
|
+
allowArrayStart: true,
|
|
93
|
+
allowBlockStart: true,
|
|
94
|
+
allowClassStart: true,
|
|
95
|
+
allowObjectStart: true,
|
|
96
|
+
applyDefaultIgnorePatterns: true,
|
|
97
|
+
beforeBlockComment: true,
|
|
98
|
+
beforeLineComment: true,
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
'@stylistic/lines-between-class-members': [
|
|
102
|
+
error,
|
|
103
|
+
{
|
|
104
|
+
enforce: [
|
|
105
|
+
{ blankLine: always, next: 'method', prev: '*' },
|
|
106
|
+
{ blankLine: always, next: '*', prev: 'method' },
|
|
107
|
+
{ blankLine: never, next: 'field', prev: 'field' },
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
{ exceptAfterSingleLine: true },
|
|
111
|
+
],
|
|
112
|
+
'@stylistic/member-delimiter-style': [
|
|
113
|
+
error,
|
|
114
|
+
{
|
|
115
|
+
multiline: { delimiter: none },
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
'@stylistic/no-extra-parens': [error, 'functions'],
|
|
119
|
+
'@stylistic/padding-line-between-statements': error,
|
|
120
|
+
'@stylistic/quote-props': [error, 'as-needed'],
|
|
121
|
+
'@stylistic/semi': [error, never],
|
|
122
|
+
'@stylistic/space-before-blocks': [error, always],
|
|
123
|
+
'@stylistic/space-infix-ops': error,
|
|
124
|
+
'@stylistic/type-annotation-spacing': error,
|
|
125
|
+
};
|
|
126
|
+
const tsEslint = {
|
|
127
|
+
'@typescript-eslint/array-type': error,
|
|
128
|
+
'@typescript-eslint/consistent-indexed-object-style': error,
|
|
129
|
+
'@typescript-eslint/consistent-type-assertions': error,
|
|
130
|
+
'@typescript-eslint/consistent-type-definitions': error,
|
|
131
|
+
'@typescript-eslint/consistent-type-exports': error,
|
|
132
|
+
'@typescript-eslint/consistent-type-imports': error,
|
|
133
|
+
'@typescript-eslint/dot-notation': error,
|
|
134
|
+
'@typescript-eslint/naming-convention': [
|
|
135
|
+
error,
|
|
136
|
+
{ format: [camelCase], selector: 'default' },
|
|
137
|
+
{ format: [camelCase, pascalCase], selector: 'import' },
|
|
138
|
+
{ format: [camelCase], selector: 'variable' },
|
|
139
|
+
{ format: [pascalCase], selector: 'typeLike' },
|
|
140
|
+
{ format: [pascalCase], selector: 'enumMember' },
|
|
141
|
+
],
|
|
142
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
143
|
+
'@typescript-eslint/no-extraneous-class': off,
|
|
144
|
+
'@typescript-eslint/no-restricted-imports': error,
|
|
145
|
+
'@typescript-eslint/no-restricted-types': error,
|
|
146
|
+
'@typescript-eslint/no-unnecessary-condition': off,
|
|
147
|
+
'@typescript-eslint/no-unsafe-argument': 'warn',
|
|
148
|
+
'@typescript-eslint/no-unsafe-assignment': off,
|
|
149
|
+
'@typescript-eslint/no-unsafe-call': off,
|
|
150
|
+
'@typescript-eslint/no-unsafe-member-access': off,
|
|
151
|
+
'@typescript-eslint/no-unsafe-return': 'warn',
|
|
152
|
+
'@typescript-eslint/restrict-template-expressions': off,
|
|
153
|
+
'@typescript-eslint/unbound-method': off,
|
|
154
|
+
'dot-notation': off,
|
|
155
|
+
'eol-last': [error, always],
|
|
156
|
+
'import/first': error,
|
|
157
|
+
'import/named': error,
|
|
158
|
+
'import/newline-after-import': [error, { count: newlineCount }],
|
|
159
|
+
'import/no-absolute-path': error,
|
|
160
|
+
'import/no-cycle': error,
|
|
161
|
+
'import/no-duplicates': error,
|
|
162
|
+
'import/no-empty-named-blocks': error,
|
|
163
|
+
'import/no-relative-packages': error,
|
|
164
|
+
'import/no-self-import': error,
|
|
165
|
+
'import/no-unresolved': error,
|
|
166
|
+
'import/no-unused-modules': error,
|
|
167
|
+
'import/no-useless-path-segments': error,
|
|
168
|
+
'import/prefer-default-export': off,
|
|
169
|
+
'max-classes-per-file': [error, { ignoreExpressions: true, max: maxClasses }],
|
|
170
|
+
'max-lines': [error, { max: maxLinesPerFile, skipBlankLines: true, skipComments: true }],
|
|
171
|
+
'max-lines-per-function': [error, maxLinesPerFunction],
|
|
172
|
+
'newline-before-return': error,
|
|
173
|
+
'no-inline-comments': error,
|
|
174
|
+
'no-mixed-spaces-and-tabs': error,
|
|
175
|
+
'no-multiple-empty-lines': [error, { max: maxConsecutiveEmptyLines }],
|
|
176
|
+
'no-restricted-imports': off,
|
|
177
|
+
'no-unsafe-member-access': off,
|
|
178
|
+
'object-curly-newline': error,
|
|
179
|
+
'spaced-comment': [error, always, { block: { balanced: true } }],
|
|
180
|
+
};
|
|
181
|
+
const commonjsPreventRules = {
|
|
182
|
+
'@typescript-eslint/no-require-imports': off,
|
|
183
|
+
'import/no-amd': off,
|
|
184
|
+
'import/no-commonjs': off,
|
|
185
|
+
'import/no-default-export': off,
|
|
186
|
+
};
|
|
187
|
+
const rulesToDisable = {
|
|
188
|
+
'perfectionist/sort-imports': 'off',
|
|
189
|
+
};
|
|
190
|
+
const rules = {
|
|
191
|
+
...commonjsPreventRules,
|
|
192
|
+
...prettier,
|
|
193
|
+
...stylisticTs,
|
|
194
|
+
...tsEslint,
|
|
195
|
+
...rulesToDisable,
|
|
196
|
+
};
|
|
197
|
+
module.exports = {
|
|
198
|
+
commonjsPreventRules,
|
|
199
|
+
jsDoc,
|
|
200
|
+
prettier,
|
|
201
|
+
rules,
|
|
202
|
+
stylisticTs,
|
|
203
|
+
tsEslint,
|
|
204
|
+
};
|
|
205
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../rules.js"],"names":[],"mappings":";AAEA,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG;IAChD,GAAG,EAAE,KAA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,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC;CAChE,CAAA;AAKD,MAAM,oBAAoB,GAAG;IAC5B,uCAAuC,EAAE,GAAG;IAC5C,eAAe,EAAE,GAAG;IACpB,oBAAoB,EAAE,GAAG;IACzB,0BAA0B,EAAE,GAAG;CAC/B,CAAA;AAKD,MAAM,cAAc,GAAG;IACtB,4BAA4B,EAAE,KAAK;CACnC,CAAA;AAED,MAAM,KAAK,GAAG;IACb,GAAG,oBAAoB;IACvB,GAAG,QAAQ;IACX,GAAG,WAAW;IACd,GAAG,QAAQ;IACX,GAAG,cAAc;CACjB,CAAA;AAED,MAAM,CAAC,OAAO,GAAG;IAChB,oBAAoB;IACpB,KAAK;IACL,QAAQ;IACR,KAAK;IACL,WAAW;IACX,QAAQ;CACR,CAAA"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.js"],"names":[],"mappings":"AASA,0CAIC;AAWD,2FAiCC"}
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const { existsSync } = require('fs');
|
|
3
|
+
const { dirname, join } = require('path');
|
|
4
|
+
function debug(message) {
|
|
5
|
+
if (process.env.ESLINT_DEBUG) {
|
|
6
|
+
console.debug(`[Eslint]: ${message}`);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function getTsConfigFile(targetFile = process.env.ESLINT_TSCONFIG ?? 'tsconfig.eslint.json', fallbackFile = process.env.ESLINT_FALLBACK_TSCONFIG ?? 'tsconfig.json', startDir = process.env.ESLINT_START_DIR ?? process.cwd()) {
|
|
10
|
+
let currentDir = startDir;
|
|
11
|
+
debug(`Starting search for [${targetFile}] from directory [${currentDir}]`);
|
|
12
|
+
while (currentDir) {
|
|
13
|
+
const targetPath = join(currentDir, targetFile);
|
|
14
|
+
debug(`Checking if [${targetPath}] exists...`);
|
|
15
|
+
if (existsSync(targetPath)) {
|
|
16
|
+
console.log(`[Eslint] Found [${targetFile}] at [${targetPath}]`);
|
|
17
|
+
return targetPath;
|
|
18
|
+
}
|
|
19
|
+
const parentDir = dirname(currentDir);
|
|
20
|
+
if (currentDir === parentDir) {
|
|
21
|
+
debug(`Reached the root directory without finding [${targetFile}]`);
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
currentDir = parentDir;
|
|
25
|
+
}
|
|
26
|
+
const fallbackPath = join(startDir, fallbackFile);
|
|
27
|
+
debug(`Using fallback file [${fallbackFile}] at [${fallbackPath}]`);
|
|
28
|
+
return fallbackPath;
|
|
29
|
+
}
|
|
30
|
+
module.exports = {
|
|
31
|
+
debug,
|
|
32
|
+
getTsConfigFile,
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../utils.js"],"names":[],"mappings":";AACA,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AACpC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAOzC,SAAS,KAAK,CAAC,OAAO;IACrB,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,aAAa,OAAO,EAAE,CAAC,CAAA;IACtC,CAAC;AACF,CAAC;AAWD,SAAS,eAAe,CACvB,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,sBAAsB,EAClE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,eAAe,EACtE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,OAAO,CAAC,GAAG,EAAE;IAExD,IAAI,UAAU,GAAG,QAAQ,CAAA;IAEzB,KAAK,CAAC,wBAAwB,UAAU,qBAAqB,UAAU,GAAG,CAAC,CAAA;IAE3E,OAAO,UAAU,EAAE,CAAC;QACnB,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;QAE/C,KAAK,CAAC,gBAAgB,UAAU,aAAa,CAAC,CAAA;QAE9C,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,mBAAmB,UAAU,SAAS,UAAU,GAAG,CAAC,CAAA;YAEhE,OAAO,UAAU,CAAA;QAClB,CAAC;QAED,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;QACrC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC9B,KAAK,CAAC,+CAA+C,UAAU,GAAG,CAAC,CAAA;YACnE,MAAK;QACN,CAAC;QAED,UAAU,GAAG,SAAS,CAAA;IACvB,CAAC;IAED,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;IACjD,KAAK,CAAC,wBAAwB,YAAY,SAAS,YAAY,GAAG,CAAC,CAAA;IAEnE,OAAO,YAAY,CAAA;AACpB,CAAC;AAED,MAAM,CAAC,OAAO,GAAG;IAChB,KAAK;IACL,eAAe;CACf,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@creo-team/eslint-config",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Modern TypeScript/React ESLint configuration with unified stylistic rules.",
|
|
5
|
+
"author": "Colten Krauter <coltenkrauter>",
|
|
6
|
+
"main": "dist/eslint.config.js",
|
|
7
|
+
"homepage": "https://github.com/creo-team/eslint-config",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/creo-team/eslint-config.git"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"fix": "npm run lint -- --fix",
|
|
15
|
+
"lint": "npx eslint **/*.ts **/*.tsx *.js",
|
|
16
|
+
"prepublishOnly": "npm run build",
|
|
17
|
+
"test": "npm run lint",
|
|
18
|
+
"upgrade:all": "npx npm-check-updates --upgrade --reject \"eslint|@eslint/js\" && npm install"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"eslint",
|
|
22
|
+
"eslint-config",
|
|
23
|
+
"creo-team",
|
|
24
|
+
"linting",
|
|
25
|
+
"lint"
|
|
26
|
+
],
|
|
27
|
+
"license": "ISC",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@eslint/js": "^9.39.3",
|
|
30
|
+
"@stylistic/eslint-plugin": "^5.9.0",
|
|
31
|
+
"eslint": "^9.39.3",
|
|
32
|
+
"eslint-define-config": "^2.1.0",
|
|
33
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
34
|
+
"eslint-plugin-filenames": "^1.3.2",
|
|
35
|
+
"eslint-plugin-import": "^2.32.0",
|
|
36
|
+
"eslint-plugin-jsdoc": "^61.7.1",
|
|
37
|
+
"eslint-plugin-perfectionist": "^4.15.1",
|
|
38
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
39
|
+
"eslint-plugin-project-structure": "^3.14.2",
|
|
40
|
+
"typescript": "^5.9.3",
|
|
41
|
+
"typescript-eslint": "^8.56.0"
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist"
|
|
45
|
+
],
|
|
46
|
+
"type": "commonjs",
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"react": "^19.2.4",
|
|
49
|
+
"react-dom": "^19.2.4"
|
|
50
|
+
}
|
|
51
|
+
}
|