Skip to content

Commit 0f16d63

Browse files
committed
feat: nest package
1 parent 12af0d7 commit 0f16d63

7 files changed

Lines changed: 424 additions & 35 deletions

File tree

README.md

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,47 +15,20 @@ support your favorite framework.
1515

1616
### Linters
1717

18-
| Tool | Package | Version |
19-
| ------------ | -------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
20-
| Base | [@linters/eslint-config](packages/eslint-config) | [![@linters/eslint-config][es-badge]][es-npm] |
21-
| Base | [@linters/eslint-config-typescript](packages/eslint-config-typescript) | [![@linters/eslint-config-typescript][ests-badge]][ests-npm] |
22-
| Node | [@linters/eslint-config-node](packages/eslint-config-node) | [![@linters/eslint-config-node][esnode-badge]][esnode-npm] |
23-
| React | [@linters/eslint-config-react](packages/eslint-config-react) | [![@linters/eslint-config-react][esreact-badge]][esreact-npm] |
24-
| React Native | [@linters/eslint-config-react-native](packages/eslint-config-react-native) | [![@linters/eslint-config-react-native][esreacrn-badge]][esreacrn-npm] |
25-
| Angular | [@linters/eslint-config-angular](packages/eslint-config-angular) | [![@linters/eslint-config-angular][esng-badge]][esng-npm] |
26-
| Functional | [@linters/eslint-config-functional](packages/eslint-config-functional) | [![@linters/eslint-config-functional][esfc-badge]][esfc-npm] |
27-
| Jest | [@linters/eslint-config-jest](packages/eslint-config-jest) | [![@linters/eslint-config-jest][esjest-badge]][esjest-npm] |
28-
| Vitest | [@linters/eslint-config-vitest](packages/eslint-config-vitest) | [![@linters/eslint-config-vitest][esvitest-badge]][esvitest-npm] |
29-
| Storybook | [@linters/eslint-config-storybook](packages/eslint-config-storybook) | [![@linters/eslint-config-storybook][esstorybook-badge]][esstorybook-npm] |
30-
| Ramda | [@linters/eslint-config-ramda](packages/eslint-config-ramda) | [![@linters/eslint-config-ramda][esrm-badge]][esrm-npm] |
18+
| Tool | Package | Version |
19+
| ------ | ---------------------------------------------------------------------- | ---------------------------------------------------------------- |
20+
| Base | [@linters/eslint-config](packages/eslint-config) | [![@linters/eslint-config][es-badge]][es-npm] |
21+
| Base | [@linters/eslint-config-typescript](packages/eslint-config-typescript) | [![@linters/eslint-config-typescript][ests-badge]][ests-npm] |
22+
| Node | [@linters/eslint-config-node](packages/eslint-config-node) | [![@linters/eslint-config-node][esnode-badge]][esnode-npm] |
23+
| Vitest | [@linters/eslint-config-vitest](packages/eslint-config-vitest) | [![@linters/eslint-config-vitest][esvitest-badge]][esvitest-npm] |
24+
| Nest | [@linters/eslint-config-nest](packages/eslint-config-nest) | [![@linters/eslint-config-nest][nest-badge]][nest-npm] |
3125

3226
### Prettier
3327

3428
| Tool | Package | Version |
3529
| -------- | ---------------------------------------------------- | ----------------------------------------------- |
3630
| Prettier | [@linters/prettier-config](packages/prettier-config) | [![@linters/prettier-config][pr-badge]][pr-npm] |
3731

38-
### Styles
39-
40-
| Tool | Package | Version |
41-
| --------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
42-
| Default | [@linters/stylelint-config](packages/stylelint-config) | [![@linters/stylelint-config][sl-badge]][sl-npm] |
43-
| CSS-in-JS | [@linters/stylelint-css-in-js-config](packages/stylelint-css-in-js-config) | [![@linters/stylelint-css-in-js-config][sljs-badge]][sljs-npm] |
44-
| CSS-in-JS | [@linters/stylelint-css-in-js-react-native-config](packages/stylelint-css-in-js-react-native-config) | [![@linters/stylelint-css-in-js-react-native-config][sljsrn-badge]][sljsrn-npm] |
45-
| SCSS | [@linters/stylelint-scss-config](packages/stylelint-scss-config) | [![@linters/stylelint-scss-config][slscss-badge]][slscss-npm] |
46-
47-
### Git Hooks
48-
49-
| Tool | Package | Version |
50-
| ----- | ------------------------------------------------------ | ------------------------------------------------ |
51-
| Other | [@linters/semantic-release](packages/semantic-release) | [![@linters/semantic-release][sr-badge]][sr-npm] |
52-
53-
### Other Tools
54-
55-
| Tool | Package | Version |
56-
| ----- | ------------------------------------------------------ | ------------------------------------------------ |
57-
| Other | [@linters/semantic-release](packages/semantic-release) | [![@linters/semantic-release][sr-badge]][sr-npm] |
58-
5932
## Contributing
6033

6134
**If you don't like what you see and want to make it better**, now is your chance!
@@ -98,3 +71,5 @@ See the [contributing docs](/CONTRIBUTING.md) for more information
9871
[slscss-npm]: https://badge.fury.io/js/%40linters%2Fstylelint-scss-config
9972
[pr-badge]: https://badge.fury.io/js/%40linters%2Fprettier-config.svg
10073
[pr-npm]: https://badge.fury.io/js/%40linters%2Fprettier-config
74+
[nest-badge]: https://badge.fury.io/js/%40linters%2Feslint-config-nest.svg
75+
[nest-npm]: https://badge.fury.io/js/%40linters%2Feslint-config-nest
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2019 Code Quality Resources
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# ESLint Config Vitest
2+
3+
[**eslint**](https://github.com/eslint/eslint) shareable config to help you identify and report on patterns found in your tests.
4+
5+
## Plugins
6+
7+
This configuration uses the following plugins:
8+
9+
- [`eslint-plugin-vitest`](https://github.com/veritem/eslint-plugin-vitest)
10+
11+
## Install
12+
13+
```bash
14+
$ yarn add @linters/eslint-config-vitest -D
15+
```
16+
17+
## Usage
18+
19+
The shareable config can be configured in the [**eslint** configuration file](https://eslint.org/docs/user-guide/configuring):
20+
21+
Create a _.eslintrc.js_ file with the following contents:
22+
23+
```js
24+
module.exports = {
25+
extends: ["@linters/eslint-config-vitest"],
26+
};
27+
```
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import eslintNestJs from "@darraghor/eslint-plugin-nestjs-typed";
2+
3+
const nestjsRules = {
4+
"@darraghor/nestjs-typed/provided-injected-should-match-factory-parameters":
5+
"error",
6+
"@darraghor/nestjs-typed/injectable-should-be-provided": "error",
7+
"@darraghor/nestjs-typed/use-injectable-provided-token": "error",
8+
"@darraghor/nestjs-typed/use-dependency-injection": "error",
9+
"@darraghor/nestjs-typed/api-property-matches-property-optionality": "error",
10+
"@darraghor/nestjs-typed/controllers-should-supply-api-tags": "error",
11+
"@darraghor/nestjs-typed/api-method-should-specify-api-response": "error",
12+
"@darraghor/nestjs-typed/api-method-should-specify-api-operation": "error",
13+
"@darraghor/nestjs-typed/api-enum-property-best-practices": "error",
14+
"@darraghor/nestjs-typed/api-property-returning-array-should-set-array":
15+
"error",
16+
"@darraghor/nestjs-typed/api-property-should-have-api-extra-models": "error",
17+
"@darraghor/nestjs-typed/api-operation-summary-description-capitalized":
18+
"error",
19+
"@darraghor/nestjs-typed/param-decorator-name-matches-route-param": "error",
20+
"@darraghor/nestjs-typed/validate-nested-of-array-should-set-each": "error",
21+
"@darraghor/nestjs-typed/validated-non-primitive-property-needs-type-decorator":
22+
"error",
23+
"@darraghor/nestjs-typed/all-properties-are-whitelisted": "error",
24+
"@darraghor/nestjs-typed/all-properties-have-explicit-defined": "error",
25+
"@darraghor/nestjs-typed/no-duplicate-decorators": "error",
26+
"@darraghor/nestjs-typed/validation-pipe-should-use-forbid-unknown": "error",
27+
"@darraghor/nestjs-typed/api-methods-should-be-guarded": "error",
28+
"@darraghor/nestjs-typed/sort-module-metadata-arrays": "error",
29+
"@darraghor/nestjs-typed/use-correct-endpoint-naming-convention": "error",
30+
};
31+
32+
const nestjsConfig = [
33+
{
34+
files: ["**/*.ts"],
35+
plugins: {
36+
"@darraghor/nestjs-typed": eslintNestJs,
37+
},
38+
rules: nestjsRules,
39+
},
40+
];
41+
42+
export default nestjsConfig;
43+
export { nestjsRules };
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "@linters/eslint-config-nest",
3+
"description": "The eslint for Nest.js you have been looking for.",
4+
"version": "2.1.0",
5+
"repository": "https://github.com/developer239/linters",
6+
"main": "index.js",
7+
"type": "module",
8+
"publishConfig": {
9+
"access": "public"
10+
},
11+
"engines": {
12+
"node": ">=18.18.0"
13+
},
14+
"peerDependencies": {
15+
"eslint": ">=9.0.0"
16+
},
17+
"dependencies": {
18+
"@darraghor/eslint-plugin-nestjs-typed": "7.1.18",
19+
"@typescript-eslint/utils": "8.53.0"
20+
},
21+
"keywords": [
22+
"eslint",
23+
"code-style",
24+
"semantic-release",
25+
"config",
26+
"vitest",
27+
"tests",
28+
"typescript",
29+
"node",
30+
"react",
31+
"react-native",
32+
"flat-config",
33+
"nestjs"
34+
]
35+
}

0 commit comments

Comments
 (0)