-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move eslint-rules to eslint-plugin
- Loading branch information
Showing
16 changed files
with
58 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/eslint-rules/jest.config.ts → packages/eslint-plugin/jest.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
/* eslint-disable */ | ||
export default { | ||
displayName: 'eslint-rules', | ||
displayName: 'eslint-plugin', | ||
preset: '../../jest.preset.js', | ||
testEnvironment: 'node', | ||
transform: { | ||
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }], | ||
}, | ||
moduleFileExtensions: ['ts', 'js', 'html'], | ||
coverageDirectory: '../../coverage/packages/eslint-rules', | ||
coverageDirectory: '../../coverage/packages/eslint-plugin', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
{ | ||
"name": "@getlarge/nestjs-tools-eslint-rules", | ||
"name": "@getlarge/eslint-plugin-nestjs-tools", | ||
"version": "0.1.0", | ||
"description": "ESLint rules for NestJS applications", | ||
"keywords": [ | ||
"eslint", | ||
"eslint-plugin", | ||
"eslintplugin", | ||
"nestjs", | ||
"rules", | ||
"typescript", | ||
|
@@ -12,13 +14,16 @@ | |
], | ||
"license": "Apache-2.0", | ||
"author": "Edouard Maleix <[email protected]>", | ||
"homepage": "https://github.com/getlarge/nestjs-tools/tree/main/packages/eslint-rules", | ||
"homepage": "https://github.com/getlarge/nestjs-tools/tree/main/packages/eslint-plugin", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"@typescript-eslint/utils": "8.5.0" | ||
}, | ||
"peerDependencies": { | ||
"eslint": "7 || 8 || 9" | ||
"@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", | ||
"eslint": "^8.57.0 || ^9.0.0" | ||
}, | ||
"type": "commonjs", | ||
"main": "./src/index.js", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "eslint-plugin-nestjs-tools", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "packages/eslint-plugin/src", | ||
"projectType": "library", | ||
"tags": [], | ||
"// targets": "to see all targets run: nx show project eslint-plugin-nestjs-tools --web", | ||
"targets": { | ||
"build": { | ||
"executor": "@nx/js:tsc", | ||
"outputs": ["{options.outputPath}"], | ||
"options": { | ||
"outputPath": "dist/packages/eslint-plugin", | ||
"tsConfig": "packages/eslint-plugin/tsconfig.lib.json", | ||
"packageJson": "packages/eslint-plugin/package.json", | ||
"main": "packages/eslint-plugin/src/index.ts", | ||
"assets": ["packages/eslint-plugin/*.md"] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { Linter } from '@typescript-eslint/utils/dist/ts-eslint'; | ||
|
||
import { rule as returnClassInstance, RULE_NAME as returnClassInstanceName } from './lib/return-class-instance'; | ||
|
||
// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const { name, version } = require('../package.json') as { | ||
name: string; | ||
version: string; | ||
}; | ||
|
||
export default { | ||
meta: { | ||
name, | ||
version, | ||
}, | ||
rules: { [returnClassInstanceName]: returnClassInstance }, | ||
} satisfies Linter.Plugin; |
File renamed without changes.
19 changes: 1 addition & 18 deletions
19
...nt-rules/src/lib/return-class-instance.ts → ...t-plugin/src/lib/return-class-instance.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters