Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb73feaf

Browse files
committed
setup linting/styles
1 parentb9de7ed commitb73feaf

File tree

10 files changed

+96
-32
lines changed

10 files changed

+96
-32
lines changed

‎.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
out
21
node_modules
32
.vscode-test/
43
*.vsix
4+
5+
# output directory
6+
out

‎.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports={
2+
printWidth:120,
3+
semi:false,
4+
singleQuote:true,
5+
tabWidth:2,
6+
trailingComma:'all',
7+
}

‎.vscode/settings.json

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
1-
// Place your settings in this file to overwrite default and user settings.
21
{
3-
"files.exclude": {
4-
"out":false// set this to true to hide the "out" folder with the compiled JS files
5-
},
6-
"search.exclude": {
7-
"out":true// set this to false to include "out" folder in search results
8-
},
9-
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
10-
"typescript.tsc.autoDetect":"off"
11-
}
2+
// autofix
3+
// "eslint.autoFixOnSave": true,
4+
// "eslint.validate": [
5+
// "javascript",
6+
// {
7+
// "language": "typescript",
8+
// "autoFix": true
9+
//},
10+
// {
11+
// "language": "typescriptreact",
12+
// "autoFix": true
13+
// }
14+
// ],
15+
"editor.codeActionsOnSave": {
16+
"source.fixAll":true,
17+
},
18+
"tslint.enable":true,
19+
"tslint.jsEnable":true,
20+
"[javascript]": {
21+
"editor.formatOnSave":true
22+
},
23+
"[typescript]": {
24+
"editor.formatOnSave":true
25+
},
26+
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
27+
// "typescript.tsc.autoDetect": "off",
28+
"files.exclude": {
29+
"out":false// set this to true to hide the "out" folder with the compiled JS files
30+
},
31+
"search.exclude": {
32+
"out":true// set this to false to include "out" folder in search results
33+
},
34+
}

‎package-lock.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name":"coderoad-vscode",
33
"displayName":"coderoad-vscode",
4-
"description":"interactive tutorials in your editor",
4+
"description":"Interactive tutorials in your editor",
55
"version":"0.0.1",
66
"engines": {
77
"vscode":"^1.34.0"
@@ -29,10 +29,12 @@
2929
"test":"npm run compile && node ./node_modules/vscode/bin/test"
3030
},
3131
"devDependencies": {
32-
"typescript":"^3.3.1",
33-
"vscode":"^1.1.28",
34-
"tslint":"^5.12.1",
32+
"@types/mocha":"^2.2.42",
3533
"@types/node":"^10.12.21",
36-
"@types/mocha":"^2.2.42"
34+
"prettier":"^1.17.1",
35+
"tslint":"^5.12.1",
36+
"tslint-config-prettier":"^1.18.0",
37+
"typescript":"^3.3.1",
38+
"vscode":"^1.1.28"
3739
}
3840
}

‎src/extension.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// The module 'vscode' contains the VS Code extensibility API
22
// Import the module and reference it with the alias vscode in your code below
3-
import*asvscodefrom'vscode';
3+
import*asvscodefrom'vscode'
44

55
// this method is called when your extension is activated
66
// your extension is activated the very first time the command is executed
77
exportfunctionactivate(context:vscode.ExtensionContext){
88

99
// Use the console to output diagnostic information (console.log) and errors (console.error)
1010
// This line of code will only be executed once when your extension is activated
11-
console.log('Congratulations, your extension "coderoad-vscode" is now active!');
11+
console.log('Congratulations, your extension "coderoad-vscode" is now active!')
1212

1313
// The command has been defined in the package.json file
1414
// Now provide the implementation of the command with registerCommand
@@ -17,11 +17,11 @@ export function activate(context: vscode.ExtensionContext) {
1717
// The code you place here will be executed every time your command is executed
1818

1919
// Display a message box to the user
20-
vscode.window.showInformationMessage('HelloWorld!');
21-
});
20+
vscode.window.showInformationMessage('HelloYou!')
21+
})
2222

2323
context.subscriptions.push(disposable);
2424
}
2525

2626
// this method is called when your extension is deactivated
27-
exportfunctiondeactivate(){}
27+
exportfunctiondeactivate(){}

‎src/test/extension.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import * as assert from 'assert';
1515
suite("Extension Tests",function(){
1616

1717
// Defines a Mocha unit test
18-
test("Something 1",function(){
18+
test("Something 1",function(){
1919
assert.equal(-1,[1,2,3].indexOf(5));
2020
assert.equal(-1,[1,2,3].indexOf(0));
2121
});

‎src/test/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
// to report the results back to the caller. When the tests are finished, return
1111
// a possible error to the callback or null if none.
1212

13-
import*astestRunnerfrom'vscode/lib/testrunner';
13+
import*astestRunnerfrom'vscode/lib/testrunner'
1414

1515
// You can directly control Mocha options by configuring the test runner below
1616
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options
1717
// for more info
1818
testRunner.configure({
1919
ui:'tdd',// the TDD UI is being used in extension.test.ts (suite, test, etc.)
2020
useColors:true// colored output from test results
21-
});
21+
})
2222

23-
module.exports=testRunner;
23+
module.exports=testRunner

‎tsconfig.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,20 @@
88
],
99
"sourceMap":true,
1010
"rootDir":"src",
11-
"strict":true/* enable all strict type-checking options*/
11+
"strict":true,/* enable all strict type-checking options*/
1212
/* Additional Checks*/
13-
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
14-
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
15-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
13+
"forceConsistentCasingInFileNames":true,
14+
"noImplicitReturns":true,
15+
"noImplicitThis":true,
16+
"noImplicitAny":true,
17+
"strictNullChecks":true,
18+
"suppressImplicitAnyIndexErrors":true,
19+
"noUnusedLocals":false,
20+
"experimentalDecorators":true,
21+
"emitDecoratorMetadata":true
22+
},
23+
"paths": {
24+
"typings":"./src/typings/index.d.ts"
1625
},
1726
"exclude": [
1827
"node_modules",

‎tslint.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
2+
"extends": [
3+
"tslint:latest",
4+
"tslint-config-prettier"
5+
],
26
"rules": {
37
"no-string-throw":true,
48
"no-unused-expression":true,
@@ -7,9 +11,14 @@
711
"class-name":true,
812
"semicolon": [
913
true,
10-
"always"
14+
"never"
1115
],
12-
"triple-equals":true
16+
"triple-equals":true,
17+
"interface-name": [
18+
true,
19+
"never-prefix"
20+
]
1321
},
14-
"defaultSeverity":"warning"
22+
"defaultSeverity":"warning",
23+
"no-submodule-imports":false,
1524
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp