Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit e550d5e

Browse files
authored
[CHORE] switched to prettier-eslint and added vscode config (#182)
Added config for the vscode prettier extension because I got sick of manually formatting and relying on the on commit formatter.. Also switched to `prettier-eslint` so that the eslint fixers get auto-run by the format process.
1 parent 0996b3b commit e550d5e

57 files changed

Lines changed: 4243 additions & 3805 deletions

Some content is hidden

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

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ indent_style = space
55
indent_size = 4
66
trim_trailing_whitespace = true
77
end_of_line = lf
8-
insert_final_newline = true
8+
insert_final_newline = true

.eslintrc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"root": true,
3+
"plugins": [
4+
"node",
5+
"prettier"
6+
],
7+
"extends": [
8+
"eslint",
9+
"plugin:node/recommended",
10+
"prettier"
11+
],
12+
"rules": {
13+
"prettier/prettier": [
14+
"error",
15+
{
16+
"tabWidth": 4
17+
}
18+
],
19+
"lines-around-comment": "off"
20+
}
21+
}

.eslintrc.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ versions.json
1212
.eslintcache
1313
.cache
1414
/packages/**/node_modules
15-
/.vscode
1615
.sublimelinterrc
1716
yarn.lock

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"arrowParens": "avoid",
3+
"bracketSpacing": true,
4+
"jsxBracketSameLine": true,
5+
"proseWrap": "preserve",
6+
"semi": true,
7+
"singleQuote": false,
8+
"tabWidth": 4,
9+
"trailingComma": "es5",
10+
"useTabs": false
11+
}

.vscode/settings.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
// Format a file on save. A formatter must be available, the file must not be auto-saved, and editor must not be shutting down.
3+
"editor.formatOnSave": true,
4+
5+
// An array of languages where Emmet abbreviations should not be expanded.
6+
"emmet.excludeLanguages": [
7+
"markdown",
8+
"typescript"
9+
],
10+
11+
// An array of language ids which should be validated by ESLint
12+
"eslint.validate": [
13+
"javascript",
14+
"javascriptreact",
15+
{
16+
"language": "typescript",
17+
"autoFix": true
18+
},
19+
{
20+
"language": "typescriptreact",
21+
"autoFix": true
22+
}
23+
],
24+
25+
// When enabled, will trim trailing whitespace when saving a file.
26+
"files.trimTrailingWhitespace": true,
27+
28+
// Use 'prettier-eslint' instead of 'prettier'. Other settings will only be fallbacks in case they could not be inferred from eslint rules.
29+
"prettier.eslintIntegration": true,
30+
31+
// typescript auto-format settings
32+
"typescript.tsdk": "node_modules/typescript/lib",
33+
"javascript.preferences.importModuleSpecifier": "auto",
34+
"typescript.preferences.importModuleSpecifier": "auto",
35+
"javascript.preferences.quoteStyle": "double",
36+
"typescript.preferences.quoteStyle": "double",
37+
"typescript.updateImportsOnFileMove.enabled": "always",
38+
}

lib/rules/adjacent-overload-signatures.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ module.exports = {
1414
description: "Require that member overloads be consecutive",
1515
category: "TypeScript",
1616
url:
17-
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/adjacent-overload-signatures.md"
17+
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/adjacent-overload-signatures.md",
1818
},
19-
schema: []
19+
schema: [],
2020
},
2121

2222
create(context) {
@@ -92,7 +92,7 @@ module.exports = {
9292
if (index > -1 && lastName !== name) {
9393
context.report({
9494
node: member,
95-
message: `All '${name}' signatures should be adjacent`
95+
message: `All '${name}' signatures should be adjacent`,
9696
});
9797
} else if (name && index === -1) {
9898
seen.push(name);
@@ -111,7 +111,7 @@ module.exports = {
111111
TSTypeLiteral: checkBodyForOverloadMethods,
112112
TSInterfaceBody: checkBodyForOverloadMethods,
113113
ClassBody: checkBodyForOverloadMethods,
114-
Program: checkBodyForOverloadMethods
114+
Program: checkBodyForOverloadMethods,
115115
};
116-
}
116+
},
117117
};

lib/rules/class-name-casing.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ module.exports = {
1818
category: "Best Practices",
1919
recommended: true,
2020
url:
21-
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/class-name-casing.md"
22-
}
21+
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/class-name-casing.md",
22+
},
2323
},
2424

2525
create(context) {
@@ -63,7 +63,7 @@ module.exports = {
6363

6464
context.report({
6565
node: id,
66-
message: `${friendlyName} '${id.name}' must be PascalCased`
66+
message: `${friendlyName} '${id.name}' must be PascalCased`,
6767
});
6868
}
6969

@@ -88,7 +88,7 @@ module.exports = {
8888
report(node.init, id);
8989
}
9090
}
91-
}
91+
},
9292
};
93-
}
93+
},
9494
};

lib/rules/explicit-function-return-type.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ module.exports = {
1818

1919
category: "TypeScript",
2020
url:
21-
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/explicit-function-return-type.md"
21+
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/explicit-function-return-type.md",
2222
},
2323
schema: [
2424
{
2525
type: "object",
2626
properties: {
2727
allowExpressions: {
28-
type: "boolean"
29-
}
28+
type: "boolean",
29+
},
3030
},
31-
additionalProperties: false
32-
}
33-
]
31+
additionalProperties: false,
32+
},
33+
],
3434
},
3535

3636
create(context) {
@@ -86,7 +86,7 @@ module.exports = {
8686
) {
8787
context.report({
8888
node,
89-
message: `Missing return type on function.`
89+
message: `Missing return type on function.`,
9090
});
9191
}
9292
}
@@ -97,7 +97,7 @@ module.exports = {
9797
return {
9898
FunctionDeclaration: checkFunctionReturnType,
9999
FunctionExpression: checkFunctionReturnType,
100-
ArrowFunctionExpression: checkFunctionReturnType
100+
ArrowFunctionExpression: checkFunctionReturnType,
101101
};
102-
}
102+
},
103103
};

0 commit comments

Comments
 (0)