Update prettier (#125)
* update prettier package * apply prettier * reverting back to trailingComma all * removing unneeded options
This commit is contained in:
Родитель
6c4a9835e3
Коммит
9a1d69a11e
|
@ -1,8 +1,7 @@
|
|||
{
|
||||
"tabWidth": 4,
|
||||
"trailingComma": "all",
|
||||
"parser": "typescript",
|
||||
"arrowParens": "avoid",
|
||||
"endOfLine": "auto",
|
||||
"printWidth": 120,
|
||||
"semi": true,
|
||||
"singleQuote": false
|
||||
"tabWidth": 4,
|
||||
"trailingComma": "all"
|
||||
}
|
||||
|
|
|
@ -936,9 +936,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"prettier": {
|
||||
"version": "1.19.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
|
||||
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.4.tgz",
|
||||
"integrity": "sha512-SVJIQ51spzFDvh4fIbCLvciiDMCrRhlN3mbZvv/+ycjvmF5E73bKdGfU8QDLNmjYJf+lsGnDBC4UUnvTe5OO0w==",
|
||||
"dev": true
|
||||
},
|
||||
"process-nextick-args": {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
"mocha-junit-reporter": "^1.23.1",
|
||||
"mocha-multi-reporters": "^1.1.7",
|
||||
"performance-now": "^2.1.0",
|
||||
"prettier": "^1.19.1",
|
||||
"prettier": "^2.0.4",
|
||||
"ts-loader": "^6.2.0",
|
||||
"ts-node": "^8.4.1",
|
||||
"tslint": "^5.20.0",
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -36,7 +36,7 @@ export function maybeActiveNode(
|
|||
position: Position,
|
||||
): ActiveNode | undefined {
|
||||
const astSearch: AstNodeSearch = positionAstSearch(nodeIdMapCollection, leafNodeIds, position);
|
||||
const maybeContextSearch: ParseContext.Node | undefined = positionContextSearch(astSearch, nodeIdMapCollection);
|
||||
const maybeContextSearch: ParseContext.Node | undefined = positionContextSearch(nodeIdMapCollection, astSearch);
|
||||
|
||||
let maybeLeaf: TXorNode | undefined;
|
||||
if (astSearch.maybeShiftedNode !== undefined) {
|
||||
|
@ -59,7 +59,7 @@ export function maybeActiveNode(
|
|||
return {
|
||||
position,
|
||||
ancestry: NodeIdMapIterator.expectAncestry(nodeIdMapCollection, leaf.node.id),
|
||||
maybeIdentifierUnderPosition: maybeIdentifierUnderPosition(nodeIdMapCollection, leaf, position),
|
||||
maybeIdentifierUnderPosition: maybeIdentifierUnderPosition(nodeIdMapCollection, position, leaf),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -220,8 +220,8 @@ function positionAstSearch(
|
|||
}
|
||||
|
||||
function positionContextSearch(
|
||||
astNodeSearch: AstNodeSearch,
|
||||
nodeIdMapCollection: NodeIdMap.Collection,
|
||||
astNodeSearch: AstNodeSearch,
|
||||
): ParseContext.Node | undefined {
|
||||
if (astNodeSearch.maybeNode === undefined) {
|
||||
return undefined;
|
||||
|
@ -246,8 +246,8 @@ function positionContextSearch(
|
|||
|
||||
function maybeIdentifierUnderPosition(
|
||||
nodeIdMapCollection: NodeIdMap.Collection,
|
||||
leaf: TXorNode,
|
||||
position: Position,
|
||||
leaf: TXorNode,
|
||||
): Ast.Identifier | Ast.GeneralizedIdentifier | undefined {
|
||||
if (leaf.kind !== XorNodeKind.Ast) {
|
||||
return undefined;
|
||||
|
|
|
@ -124,7 +124,6 @@ function traverseAncestors(
|
|||
maybeInspected = autocompleteKeywordConstant(activeNode, child, maybeMappedKeywordKind);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ export function tryInvokeExpression(
|
|||
}
|
||||
|
||||
const inspected: InspectedInvokeExpression = {
|
||||
xorNode: xorNode,
|
||||
xorNode,
|
||||
maybeName: maybeInvokeExpressionName(nodeIdMapCollection, xorNode.node.id),
|
||||
maybeArguments: inspectInvokeExpressionArguments(nodeIdMapCollection, activeNode, ancestryIndex),
|
||||
};
|
||||
|
|
|
@ -139,7 +139,6 @@ function inspectNode(state: ScopeInspectionState, xorNode: TXorNode): void {
|
|||
|
||||
default:
|
||||
getOrCreateScope(state, xorNode.node.id, undefined);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@ const GeneralizedIdentifierTerminatorTokenKinds: ReadonlyArray<TokenKind> = [
|
|||
TokenKind.RightBracket,
|
||||
];
|
||||
|
||||
// -------------------------------------------
|
||||
// ---------- // 12.1.6 Identifiers ----------
|
||||
// -------------------------------------------
|
||||
// ----------------------------------------
|
||||
// ---------- 12.1.6 Identifiers ----------
|
||||
// ----------------------------------------
|
||||
|
||||
export function readIdentifier<S = IParserState>(
|
||||
state: IParserState,
|
||||
|
|
94
tslint.json
94
tslint.json
|
@ -4,25 +4,44 @@
|
|||
"no-angle-bracket-type-assertion": true,
|
||||
"no-internal-module": true,
|
||||
"no-namespace": true,
|
||||
"object-literal-shorthand": true,
|
||||
"prettier": true,
|
||||
|
||||
// Internal
|
||||
"blank-lines-between-switch-cases": true,
|
||||
"deprecated-reason": true,
|
||||
"format-imports": true,
|
||||
"format-string-resources": true,
|
||||
"format-todos": true,
|
||||
"no-jsx-element": true,
|
||||
"no-methods-in-interfaces": true,
|
||||
"no-partial-default-props": true,
|
||||
"no-redux-combine-reducer": true,
|
||||
"safe-members-for-props": true,
|
||||
"sort-string-resources": true,
|
||||
"use-create-error-with-stack": true,
|
||||
"validate-imports": true,
|
||||
// tslint-microsoft-contrib rules we use with some configuration
|
||||
"comment-format": [true, "check-space"],
|
||||
/*
|
||||
"file-header": [
|
||||
true,
|
||||
{
|
||||
"match": "TODO",
|
||||
"allow-single-line-comments": true
|
||||
}
|
||||
],
|
||||
*/
|
||||
"function-name": [
|
||||
true,
|
||||
{
|
||||
// default
|
||||
"method-regex": "^[a-z][\\w\\d]+$",
|
||||
|
||||
// default
|
||||
"private-method-regex": "^[a-z][\\w\\d]+$",
|
||||
|
||||
// default
|
||||
"protected-method-regex": "^[a-z][\\w\\d]+$",
|
||||
|
||||
// changed from uppercase to lowercase
|
||||
"static-method-regex": "^[a-z][\\w\\d]+$",
|
||||
|
||||
// changed from lowercase to also allow uppercase (functional components)
|
||||
"function-regex": "^([a-z]|[A-Z])[\\w\\d]+$"
|
||||
}
|
||||
|
@ -55,9 +74,16 @@
|
|||
]
|
||||
}
|
||||
],
|
||||
"no-implicit-dependencies": [true, "dev"],
|
||||
"no-import-side-effect": [true, { "ignore-module": "mocha" }],
|
||||
"no-import-side-effect": [
|
||||
true,
|
||||
{
|
||||
"ignore-module": "mocha"
|
||||
}
|
||||
],
|
||||
"no-restricted-globals": [true, "name", "length", "event"],
|
||||
"no-void-expression": [true, "ignore-arrow-function-shorthand"],
|
||||
"one-variable-per-declaration": [true, "ignore-for-loop"],
|
||||
"triple-equals": [true, "allow-undefined-check"],
|
||||
"typedef": [
|
||||
true,
|
||||
"member-variable-declaration",
|
||||
|
@ -66,36 +92,68 @@
|
|||
"call-signature",
|
||||
"parameter"
|
||||
],
|
||||
"variable-name": [true, "ban-keywords", "check-format", "allow-pascal-case", "allow-leading-underscore"],
|
||||
|
||||
"variable-name": [
|
||||
true,
|
||||
"ban-keywords",
|
||||
"check-format",
|
||||
"allow-pascal-case",
|
||||
"allow-snake-case",
|
||||
"allow-leading-underscore"
|
||||
],
|
||||
// tslint-microsoft-contrib rules we don't use
|
||||
"binary-expression-operand-order": false,
|
||||
"completed-docs": false,
|
||||
"cyclomatic-complexity": false,
|
||||
"encoding": false,
|
||||
"export-name": false,
|
||||
"import-name": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"match-default-export-name": false,
|
||||
"max-classes-per-file": false,
|
||||
"max-func-body-length": false,
|
||||
"missing-jsdoc": false, // this will also be deprecated in tslint-microsoft-contrib 5.2.1
|
||||
"mocha-no-side-effect-code": false,
|
||||
"newline-before-return": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-any": false,
|
||||
"no-cookies": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-increment-decrement": false,
|
||||
"no-parameter-properties": false,
|
||||
"no-reserved-keywords": false,
|
||||
"no-suspicious-comment": false,
|
||||
"no-use-before-declare": false,
|
||||
"ordered-imports": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-type-cast": false,
|
||||
"prefer-method-signature": false,
|
||||
// tslint-microsoft-contrib rules we're temporarily disabling
|
||||
"await-promise": false,
|
||||
"cyclomatic-complexity": false,
|
||||
"import-spacing": false,
|
||||
"insecure-random": false,
|
||||
"match-default-export-name": false,
|
||||
"no-backbone-get-set-outside-model": false,
|
||||
"no-empty-interface": false,
|
||||
"no-floating-promises": false,
|
||||
"no-for-in": false,
|
||||
"no-function-expression": false,
|
||||
"no-invalid-template-strings": false,
|
||||
"no-invalid-this": false,
|
||||
"no-non-null-assertion": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-parameter-properties": false,
|
||||
"no-parameter-reassignment": false,
|
||||
"no-relative-imports": false,
|
||||
"no-single-line-block-comment": false,
|
||||
"no-suspicious-comment": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-initializer": false,
|
||||
"no-unnecessary-local-variable": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-unsafe-any": false,
|
||||
"no-use-before-declare": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-type-cast": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-template": false,
|
||||
"promise-function-async": false,
|
||||
"restrict-plus-operands": false,
|
||||
"strict-boolean-expressions": false,
|
||||
"switch-final-break": false,
|
||||
"type-literal-delimiter": false,
|
||||
"use-default-type-parameter": false
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче