Skip to content

Commit

Permalink
feat(eslint-plugin): Migrate plugin to ts (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradzacher authored and JamesHenry committed Feb 11, 2019
1 parent 5e3e285 commit 61c60dc
Show file tree
Hide file tree
Showing 168 changed files with 7,846 additions and 5,632 deletions.
19 changes: 3 additions & 16 deletions .eslintrc.json
Expand Up @@ -30,7 +30,7 @@
{
"files": [
"packages/eslint-plugin-tslint/tests/**/*.ts",
"packages/eslint-plugin/tests/**/*.js",
"packages/eslint-plugin/tests/**/*.test.ts",
"packages/parser/tests/**/*.ts",
"packages/typescript-estree/tests/**/*.ts"
],
Expand All @@ -53,22 +53,9 @@
}
},
{
"files": ["packages/eslint-plugin/**/*.js"],
"files": ["packages/eslint-plugin/test/**/*.ts"],
"rules": {
"eslint-plugin/fixer-return": "error",
"eslint-plugin/no-identical-tests": "error",
"eslint-plugin/no-missing-placeholders": "error",
"eslint-plugin/no-unused-placeholders": "error",
"eslint-plugin/no-useless-token-range": "error",
"eslint-plugin/require-meta-fixable": "error",
"eslint-plugin/prefer-placeholders": "error",
"eslint-plugin/prefer-replace-text": "error",
"eslint-plugin/no-deprecated-report-api": "error",
"eslint-plugin/report-message-format": ["error", "^[A-Z'{].*[\\.}]$"],
"eslint-plugin/no-deprecated-context-methods": "error",
"eslint-plugin/prefer-output-null": "error",
"eslint-plugin/test-case-shorthand-strings": "error",
"eslint-plugin/require-meta-type": "error"
"eslint-plugin/no-identical-tests": "error"
}
}
]
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Expand Up @@ -36,9 +36,6 @@ build/Release
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

Expand Down
5 changes: 3 additions & 2 deletions .vscode/launch.json
Expand Up @@ -11,9 +11,10 @@
"cwd": "${workspaceFolder}/packages/eslint-plugin/",
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
"args": [
"--colors",
"tests/lib/rules/${fileBasename}"
"--runInBand",
"tests/rules/${fileBasenameNoExtension}"
],
"sourceMaps": true,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
Expand Down
6 changes: 6 additions & 0 deletions azure-pipelines.yml
Expand Up @@ -17,6 +17,12 @@ jobs:
# bootstrap
yarn --ignore-engines --frozen-lockfile
- script: |
# Note that this command *also* typechecks tests/tools,
# whereas the build only checks src files
yarn typecheck
displayName: 'Typecheck all packages'
- script: |
yarn check-format
displayName: 'Check code formatting'
Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -7,7 +7,7 @@
"contributors": [
"James Henry <typescript-eslint@jameshenry.blog>",
"Nicholas C. Zakas",
"Brad Zacher",
"Brad Zacher <brad.zacher@gmail.com>",
"armano2",
"Jed Fox"
],
Expand All @@ -21,6 +21,7 @@
"test": "lerna run test --parallel",
"build": "lerna run build",
"clean": "lerna clean && lerna run clean",
"typecheck": "lerna run typecheck",
"lint": "eslint . --ext .js,.ts",
"lint-fix": "eslint . --ext .js,.ts --fix",
"cz": "git-cz",
Expand Down
5 changes: 3 additions & 2 deletions packages/eslint-plugin-tslint/package.json
Expand Up @@ -21,8 +21,9 @@
"scripts": {
"test": "jest --coverage",
"prebuild": "npm run clean",
"build": "tsc",
"clean": "rimraf dist/"
"build": "tsc -p tsconfig.build.json",
"clean": "rimraf dist/",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"lodash.memoize": "^4.1.2"
Expand Down
7 changes: 7 additions & 0 deletions packages/eslint-plugin-tslint/tsconfig.build.json
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist"
},
"include": ["src"]
}
9 changes: 3 additions & 6 deletions packages/eslint-plugin-tslint/tsconfig.json
@@ -1,8 +1,5 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"declaration": true,
"outDir": "./dist"
},
"include": ["src"]
"extends": "./tsconfig.build.json",
"include": ["src", "tests"],
"exclude": ["tests/test-project", "tests/test-tslint-rules-directory"]
}
6 changes: 0 additions & 6 deletions packages/eslint-plugin/.npmignore

This file was deleted.

4 changes: 2 additions & 2 deletions packages/eslint-plugin/jest.config.js
Expand Up @@ -5,9 +5,9 @@ module.exports = {
transform: {
'^.+\\.tsx?$': 'ts-jest'
},
testRegex: './tests/lib/.+\\.js$',
testRegex: './tests/.+\\.test\\.ts$',
collectCoverage: false,
collectCoverageFrom: ['lib/**/*.{js,jsx,ts,tsx}'],
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
coverageReporters: ['text-summary', 'lcov']
};
25 changes: 0 additions & 25 deletions packages/eslint-plugin/lib/index.js

This file was deleted.

138 changes: 0 additions & 138 deletions packages/eslint-plugin/lib/rules/adjacent-overload-signatures.js

This file was deleted.

96 changes: 0 additions & 96 deletions packages/eslint-plugin/lib/rules/class-name-casing.js

This file was deleted.

0 comments on commit 61c60dc

Please sign in to comment.