Skip to content

Commit

Permalink
chore: reactivate curly rule (#1478)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhhyi authored Aug 11, 2023
1 parent 721b26a commit 23f7585
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
"max": 10
}
],
"curly": "warn",
"dot-notation": "off", // disabled in favor of @typescript-eslint/dot-notation
"eqeqeq": ["error", "always"],
"etc/no-commented-out-code": "warn",
Expand Down
16 changes: 12 additions & 4 deletions e2e/cypress-ci-e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,18 @@ const run = (
config = { ...config, env: { ...config.env, numRuns: num } };

// activate video only for last run
if (num >= MAX_NUM_RUNS) config.config.video = true;
if (num > 1) config.config.trashAssetsBeforeRuns = false;
if (spec) config.spec = spec;
if (retryGroup) config.group = retryGroup;
if (num >= MAX_NUM_RUNS) {
config.config.video = true;
}
if (num > 1) {
config.config.trashAssetsBeforeRuns = false;
}
if (spec) {
config.spec = spec;
}
if (retryGroup) {
config.group = retryGroup;
}

console.log(config);

Expand Down
4 changes: 3 additions & 1 deletion eslint-rules/src/rules/sort-testbed-metadata-arrays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ const sortTestbedMetadataArraysRule: TSESLint.RuleModule<keyof typeof messages>
.map((current, index, list) => [current, list[index + 1]])
.find(([current, next]) => next && getText(current).localeCompare(getText(next)) === 1);

if (!unorderedNodes) return;
if (!unorderedNodes) {
return;
}

const [unorderedNode, nextNode] = unorderedNodes;
context.report({
Expand Down
4 changes: 3 additions & 1 deletion schematics/src/utils/lint-fix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export function applyLintFix(): Rule {
.map(action => action.path.substring(1))
.filter(path => path.endsWith('.ts') || path.endsWith('.html'))
.forEach(file => {
if (!lintFiles.includes(file)) lintFiles.push(file);
if (!lintFiles.includes(file)) {
lintFiles.push(file);
}
});

registerLintAtEnd(findProjectRoot());
Expand Down
8 changes: 6 additions & 2 deletions scripts/find-dead-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,17 @@ function checkNode(node: Node) {
.getLeadingCommentRanges()
.some(c => c.getText().includes('not-dead-code'))
) {
if (process.env.DEBUG) console.warn('ignoring (1)', node.getText());
if (process.env.DEBUG) {
console.warn('ignoring (1)', node.getText());
}
return;
}

const ignoreComment = node.getPreviousSiblingIfKind(SyntaxKind.SingleLineCommentTrivia);
if (ignoreComment?.getText().includes('not-dead-code')) {
if (process.env.DEBUG) console.warn('ignoring (2)', node.getText());
if (process.env.DEBUG) {
console.warn('ignoring (2)', node.getText());
}
return;
}

Expand Down

0 comments on commit 23f7585

Please sign in to comment.