Skip to content

Commit 95bb3ac

Browse files
authored
Merge pull request #5870 from dibarbet/eslint
Switch to eslint + prettier
2 parents 32917c2 + 17f4934 commit 95bb3ac

File tree

462 files changed

+25960
-17645
lines changed

Some content is hidden

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

462 files changed

+25960
-17645
lines changed

.eslintrc.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
module.exports = {
2+
env: {
3+
node: true
4+
},
5+
extends: [
6+
"eslint:recommended",
7+
"plugin:@typescript-eslint/recommended"
8+
],
9+
parser: "@typescript-eslint/parser",
10+
parserOptions: {
11+
project: true,
12+
tsconfigRootDir: __dirname,
13+
},
14+
plugins: [
15+
"@typescript-eslint",
16+
"unicorn",
17+
"header",
18+
"prettier"
19+
],
20+
root: true,
21+
rules: {
22+
"@typescript-eslint/no-explicit-any": "off",
23+
"@typescript-eslint/no-non-null-assertion": "off",
24+
"@typescript-eslint/semi": ["error", "always"],
25+
// Allow unused vars if prefixed by _
26+
"@typescript-eslint/no-unused-vars": [
27+
"warn",
28+
{
29+
"argsIgnorePattern": "^_",
30+
"varsIgnorePattern": "^_",
31+
"caughtErrorsIgnorePattern": "^_"
32+
}
33+
],
34+
"@typescript-eslint/no-namespace": "off",
35+
"@typescript-eslint/promise-function-async": "error",
36+
"curly": "error",
37+
"prettier/prettier": [ "error", { "endOfLine": "auto" } ],
38+
"unicorn/filename-case": [
39+
"error",
40+
{
41+
"case": "camelCase",
42+
"ignore": [
43+
"I[A-Z].*\\.ts$",
44+
"vscode-tasks\\.d\\.ts"
45+
]
46+
}
47+
],
48+
"header/header": [ 2, "block", [
49+
"---------------------------------------------------------------------------------------------",
50+
" * Copyright (c) Microsoft Corporation. All rights reserved.",
51+
" * Licensed under the MIT License. See License.txt in the project root for license information.",
52+
" *--------------------------------------------------------------------------------------------"
53+
]]
54+
},
55+
ignorePatterns: [
56+
"out/",
57+
"dist/",
58+
"wallaby.js",
59+
"webpack.config.js",
60+
".eslintrc.js",
61+
"**/*.d.ts"
62+
],
63+
};

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
out
2+
dist

.prettierrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"singleQuote": true
2+
"trailingComma": "es5",
3+
"tabWidth": 4,
4+
"semi": true,
5+
"singleQuote": true,
6+
"endOfLine":"auto"
37
}

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"esbenp.prettier-vscode"
5+
]
6+
}

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
"vsix/": true
1313
},
1414
"csharp.suppressDotnetRestoreNotification": true,
15-
"tslint.rulesDirectory": "node_modules/tslint-microsoft-contrib",
1615
"typescript.tsdk": "./node_modules/typescript/lib",
1716
"mocha.enabled": true,
1817
"omnisharp.autoStart": false,
19-
"editor.formatOnSave": false
18+
"editor.formatOnSave": false,
19+
"eslint.lintTask.enable": true
2020
}

.vscode/tasks.json

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,5 @@
4444
"Run tests in VS Code by launching the debugger with the 'Launch Tests' configuration."
4545
]
4646
},
47-
{
48-
"label": "tslint",
49-
"command": "gulp",
50-
"type": "shell",
51-
"args": [
52-
"tslint"
53-
],
54-
"problemMatcher": {
55-
"owner": "tslint",
56-
"fileLocation": [
57-
"relative",
58-
"${workspaceFolder}"
59-
],
60-
"severity": "warning",
61-
"pattern": {
62-
"regexp": "^\\[tslint\\] (.*):(\\d+):(\\d+):\\s+(.*)$",
63-
"file": 1,
64-
"line": 2,
65-
"column": 3,
66-
"message": 4
67-
}
68-
}
69-
}
7047
]
7148
}

.vscodeignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ ISSUE_TEMPLATE
3535
package-lock.json
3636
package.json
3737
tsconfig.json
38-
tslint.json
3938
version.json
4039
wallaby.js
4140
webpack.config.js

gulpfile.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as gulp from 'gulp';
7-
import * as optionsSchemaGenerator from './src/tools/GenerateOptionsSchema';
8-
import * as packageDependencyUpdater from './src/tools/UpdatePackageDependencies';
7+
import * as optionsSchemaGenerator from './src/tools/generateOptionsSchema';
8+
import * as packageDependencyUpdater from './src/tools/updatePackageDependencies';
99

1010
require('./tasks/testTasks');
1111
require('./tasks/offlinePackagingTasks');
1212
require('./tasks/backcompatTasks');
1313

1414
// Disable warning about wanting an async function
1515
// tslint:disable-next-line
16-
gulp.task('generateOptionsSchema', (): Promise<void> => {
16+
gulp.task('generateOptionsSchema', async (): Promise<void> => {
1717
optionsSchemaGenerator.GenerateOptionsSchema();
1818
return Promise.resolve();
1919
});
2020

2121
// Disable warning about wanting an async function
2222
// tslint:disable-next-line
23-
gulp.task('updatePackageDependencies', (): Promise<void> => {
23+
gulp.task('updatePackageDependencies', async (): Promise<void> => {
2424
return packageDependencyUpdater.updatePackageDependencies();
2525
});

0 commit comments

Comments
 (0)