Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code base clean up #583

Merged
merged 11 commits into from
May 25, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
root: true,
env: {
"es6": true,
"node": true,
"jest/globals": true,
},
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
'jest',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:jest/recommended',
'prettier',
'prettier/@typescript-eslint',
],
};
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# all text files will be checked in with LF as eol
* text=auto
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ stages:
env:
- YARN_GPG=no

## disable eol conversion upon clone
git:
autocrlf: input

jobs:
- stage: "verify"
name: "verify"
Expand Down
12 changes: 5 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
"node_modules/jest-editor-support/src": false,
"coverage/": true
},
"tslint.exclude": "./integrations/*",
"search.exclude": {
"out": true,
"node_modules/jest-editor-support/src": false
},
"typescript.tsdk": "./node_modules/typescript/lib",
"eslint.enable": false,
"tslint.autoFixOnSave": true,
"prettier.semi": false,
"prettier.printWidth": 120,
"prettier.trailingComma": "es5",
"prettier.singleQuote": true
// eslint
seanpoulter marked this conversation as resolved.
Show resolved Hide resolved
"eslint.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
6 changes: 4 additions & 2 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ tsconfig.json
**/tsconfig.json
jsconfig.json
jest.config.js
tslint.json
.eslintrc.js
**/.eslintrc.js
prettier.config.js
.travis.yml
yarn.lock
yarn-error.log
Expand All @@ -20,4 +22,4 @@ coverage
images/**
!images/vscode-jest.png
node_modules
webpack.config.js
webpack.config.js
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Bug-fixes within the same version aren't needed
* improve create-react-app detection logic - stephtr
* improve the detection of cases in which Jest needs to be restarted with `--watchAll` - [@lordofthelake](https://github.com/lordofthelake)
* upgrade all dependencies to the latest, except istanbul-lib-xxx, which requires more code change and will be handled in a separate coverage PR. - @connectdotz

* code base clean up: migrate from tslint to eslint and adopted the latest recommended coding style, adopt semi-colon, added more ci check... - @connectdotz
-->

### 3.2.0
Expand Down
2 changes: 1 addition & 1 deletion __mocks__/istanbul-lib-source-maps.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export = { createSourceMapStore: jest.fn() }
export = { createSourceMapStore: jest.fn() }
140 changes: 70 additions & 70 deletions __mocks__/vscode.ts
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
const languages = {
createDiagnosticCollection: jest.fn(),
registerCodeLensProvider: jest.fn(),
}
const StatusBarAlignment = { Left: 1, Right: 2 }
const window = {
createStatusBarItem: jest.fn(() => ({
show: jest.fn(),
tooltip: jest.fn(),
})),
showErrorMessage: jest.fn(),
showWarningMessage: jest.fn(),
createTextEditorDecorationType: jest.fn(),
createOutputChannel: jest.fn(),
showWorkspaceFolderPick: jest.fn(),
onDidChangeActiveTextEditor: jest.fn(),
showInformationMessage: jest.fn(),
}
const workspace = {
getConfiguration: jest.fn(),
workspaceFolders: [],
getWorkspaceFolder: jest.fn(),
onDidChangeConfiguration: jest.fn(),
onDidChangeTextDocument: jest.fn(),
onDidChangeWorkspaceFolders: jest.fn(),
}
const OverviewRulerLane = {
Left: null,
}
const Uri = {
file: f => f,
parse: jest.fn(),
}
const Range = jest.fn()
const Diagnostic = jest.fn()
const DiagnosticSeverity = { Error: 0, Warning: 1, Information: 2, Hint: 3 }
const debug = {
onDidTerminateDebugSession: jest.fn(),
startDebugging: jest.fn(),
registerDebugConfigurationProvider: jest.fn(),
}
const commands = {
executeCommand: jest.fn(),
registerCommand: jest.fn(),
}
const CodeLens = function CodeLens() {}
export {
CodeLens,
languages,
StatusBarAlignment,
window,
workspace,
OverviewRulerLane,
Uri,
Range,
Diagnostic,
DiagnosticSeverity,
debug,
commands,
}
const languages = {
createDiagnosticCollection: jest.fn(),
registerCodeLensProvider: jest.fn(),
}

const StatusBarAlignment = { Left: 1, Right: 2 }

const window = {
createStatusBarItem: jest.fn(() => ({
show: jest.fn(),
tooltip: jest.fn(),
})),
showErrorMessage: jest.fn(),
showWarningMessage: jest.fn(),
createTextEditorDecorationType: jest.fn(),
createOutputChannel: jest.fn(),
showWorkspaceFolderPick: jest.fn(),
onDidChangeActiveTextEditor: jest.fn(),
showInformationMessage: jest.fn(),
}

const workspace = {
getConfiguration: jest.fn(),
workspaceFolders: [],
getWorkspaceFolder: jest.fn(),

onDidChangeConfiguration: jest.fn(),
onDidChangeTextDocument: jest.fn(),
onDidChangeWorkspaceFolders: jest.fn(),
}

const OverviewRulerLane = {
Left: null,
}

const Uri = {
file: (f) => f,
parse: jest.fn(),
}
const Range = jest.fn()
const Diagnostic = jest.fn()
const DiagnosticSeverity = { Error: 0, Warning: 1, Information: 2, Hint: 3 }

const debug = {
onDidTerminateDebugSession: jest.fn(),
startDebugging: jest.fn(),
registerDebugConfigurationProvider: jest.fn(),
}

const commands = {
executeCommand: jest.fn(),
registerCommand: jest.fn(),
}

const CodeLens = function CodeLens() {}

export {
CodeLens,
languages,
StatusBarAlignment,
window,
workspace,
OverviewRulerLane,
Uri,
Range,
Diagnostic,
DiagnosticSeverity,
debug,
commands,
}
22 changes: 8 additions & 14 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=759670
// for the documentation about the jsconfig.json format
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules",
"bower_components",
"jspm_packages",
"tmp",
"temp"
]
// See https://go.microsoft.com/fwlink/?LinkId=759670
// for the documentation about the jsconfig.json format
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"allowSyntheticDefaultImports": true
},
"exclude": ["node_modules", "bower_components", "jspm_packages", "tmp", "temp"]
}
Loading