Skip to content

Commit 61c60dc

Browse files
bradzacherJamesHenry
authored andcommitted
feat(eslint-plugin): Migrate plugin to ts (#120)
1 parent 5e3e285 commit 61c60dc

File tree

168 files changed

+7846
-5632
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+7846
-5632
lines changed

.eslintrc.json

+3-16
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
{
3131
"files": [
3232
"packages/eslint-plugin-tslint/tests/**/*.ts",
33-
"packages/eslint-plugin/tests/**/*.js",
33+
"packages/eslint-plugin/tests/**/*.test.ts",
3434
"packages/parser/tests/**/*.ts",
3535
"packages/typescript-estree/tests/**/*.ts"
3636
],
@@ -53,22 +53,9 @@
5353
}
5454
},
5555
{
56-
"files": ["packages/eslint-plugin/**/*.js"],
56+
"files": ["packages/eslint-plugin/test/**/*.ts"],
5757
"rules": {
58-
"eslint-plugin/fixer-return": "error",
59-
"eslint-plugin/no-identical-tests": "error",
60-
"eslint-plugin/no-missing-placeholders": "error",
61-
"eslint-plugin/no-unused-placeholders": "error",
62-
"eslint-plugin/no-useless-token-range": "error",
63-
"eslint-plugin/require-meta-fixable": "error",
64-
"eslint-plugin/prefer-placeholders": "error",
65-
"eslint-plugin/prefer-replace-text": "error",
66-
"eslint-plugin/no-deprecated-report-api": "error",
67-
"eslint-plugin/report-message-format": ["error", "^[A-Z'{].*[\\.}]$"],
68-
"eslint-plugin/no-deprecated-context-methods": "error",
69-
"eslint-plugin/prefer-output-null": "error",
70-
"eslint-plugin/test-case-shorthand-strings": "error",
71-
"eslint-plugin/require-meta-type": "error"
58+
"eslint-plugin/no-identical-tests": "error"
7259
}
7360
}
7461
]

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ build/Release
3636
node_modules/
3737
jspm_packages/
3838

39-
# TypeScript v1 declaration files
40-
typings/
41-
4239
# Optional npm cache directory
4340
.npm
4441

.vscode/launch.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
"cwd": "${workspaceFolder}/packages/eslint-plugin/",
1212
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
1313
"args": [
14-
"--colors",
15-
"tests/lib/rules/${fileBasename}"
14+
"--runInBand",
15+
"tests/rules/${fileBasenameNoExtension}"
1616
],
17+
"sourceMaps": true,
1718
"console": "integratedTerminal",
1819
"internalConsoleOptions": "neverOpen"
1920
}

azure-pipelines.yml

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ jobs:
1717
# bootstrap
1818
yarn --ignore-engines --frozen-lockfile
1919
20+
- script: |
21+
# Note that this command *also* typechecks tests/tools,
22+
# whereas the build only checks src files
23+
yarn typecheck
24+
displayName: 'Typecheck all packages'
25+
2026
- script: |
2127
yarn check-format
2228
displayName: 'Check code formatting'

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"contributors": [
88
"James Henry <typescript-eslint@jameshenry.blog>",
99
"Nicholas C. Zakas",
10-
"Brad Zacher",
10+
"Brad Zacher <brad.zacher@gmail.com>",
1111
"armano2",
1212
"Jed Fox"
1313
],
@@ -21,6 +21,7 @@
2121
"test": "lerna run test --parallel",
2222
"build": "lerna run build",
2323
"clean": "lerna clean && lerna run clean",
24+
"typecheck": "lerna run typecheck",
2425
"lint": "eslint . --ext .js,.ts",
2526
"lint-fix": "eslint . --ext .js,.ts --fix",
2627
"cz": "git-cz",

packages/eslint-plugin-tslint/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
"scripts": {
2222
"test": "jest --coverage",
2323
"prebuild": "npm run clean",
24-
"build": "tsc",
25-
"clean": "rimraf dist/"
24+
"build": "tsc -p tsconfig.build.json",
25+
"clean": "rimraf dist/",
26+
"typecheck": "tsc --noEmit"
2627
},
2728
"dependencies": {
2829
"lodash.memoize": "^4.1.2"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"outDir": "./dist"
5+
},
6+
"include": ["src"]
7+
}
+3-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
2-
"extends": "../../tsconfig.json",
3-
"compilerOptions": {
4-
"declaration": true,
5-
"outDir": "./dist"
6-
},
7-
"include": ["src"]
2+
"extends": "./tsconfig.build.json",
3+
"include": ["src", "tests"],
4+
"exclude": ["tests/test-project", "tests/test-tslint-rules-directory"]
85
}

packages/eslint-plugin/.npmignore

-6
This file was deleted.

packages/eslint-plugin/jest.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ module.exports = {
55
transform: {
66
'^.+\\.tsx?$': 'ts-jest'
77
},
8-
testRegex: './tests/lib/.+\\.js$',
8+
testRegex: './tests/.+\\.test\\.ts$',
99
collectCoverage: false,
10-
collectCoverageFrom: ['lib/**/*.{js,jsx,ts,tsx}'],
10+
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
1111
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
1212
coverageReporters: ['text-summary', 'lcov']
1313
};

packages/eslint-plugin/lib/index.js

-25
This file was deleted.

packages/eslint-plugin/lib/rules/adjacent-overload-signatures.js

-138
This file was deleted.

packages/eslint-plugin/lib/rules/class-name-casing.js

-96
This file was deleted.

0 commit comments

Comments
 (0)