Skip to content

Commit 5bc0606

Browse files
renovate[bot]Josh Goldberg
andauthored
temp (#1127)
Co-authored-by: Josh Goldberg <[email protected]>
1 parent d244dd1 commit 5bc0606

22 files changed

+8050
-8031
lines changed

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run precommit

package-lock.json

Lines changed: 7965 additions & 7965 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,13 @@
3939
"babel-jest": "27.0.6",
4040
"eslint": "7.30.0",
4141
"eslint-plugin-simple-import-sort": "7.0.0",
42-
"husky": "6.0.0",
42+
"husky": "^7.0.0",
4343
"jest": "27.0.6",
4444
"lint-staged": "11.0.0",
4545
"prettier": "2.3.2",
4646
"strip-ansi": "6.0.0"
4747
},
4848
"homepage": "https://github.com/typescript-eslint/tslint-to-eslint-config#readme",
49-
"husky": {
50-
"hooks": {
51-
"pre-commit": "lint-staged"
52-
}
53-
},
5449
"keywords": [
5550
"eslint",
5651
"tslint",
@@ -71,6 +66,8 @@
7166
},
7267
"scripts": {
7368
"eslint": "eslint \"./src/*.ts\" \"./src/**/*.ts\" --report-unused-disable-directives",
69+
"precommit": "lint-staged",
70+
"prepare": "husky install",
7471
"prettier": "prettier \"./src/*.{js,json,ts,xml,yaml}\" \"./src/**/*.{js,json,ts,xml,yaml}\" --ignore-path .prettierignore",
7572
"prettier:write": "npm run prettier -- --write",
7673
"test": "jest",

src/converters/comments/parseFileComments.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ export const parseFileComments = (filePath: string, content: string) => {
3939
const tslintRegex = new RegExp(/tslint:(enable|disable)(?:-(line|next-line))?(:|\s|$)/g);
4040

4141
const parseFileComment = (fullText: string, comment: ts.CommentRange): FileComment | undefined => {
42-
const commentText = (comment.kind === ts.SyntaxKind.SingleLineCommentTrivia
43-
? fullText.substring(comment.pos + 2, comment.end)
44-
: fullText.substring(comment.pos + 2, comment.end - 2)
42+
const commentText = (
43+
comment.kind === ts.SyntaxKind.SingleLineCommentTrivia
44+
? fullText.substring(comment.pos + 2, comment.end)
45+
: fullText.substring(comment.pos + 2, comment.end - 2)
4546
).trim();
4647
const match = commentText.match(tslintRegex);
4748
if (match === null) {

src/converters/lintConfigs/formatConvertedRules.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export const formatConvertedRules = (
88
tslintConfiguration: TSLintConfiguration,
99
) => {
1010
const output: Record<string, string | any[]> = {};
11-
const sortedRuleEntries = Array.from(
12-
conversionResults.converted,
13-
).sort(([ruleNameA], [ruleNameB]) => ruleNameA.localeCompare(ruleNameB));
11+
const sortedRuleEntries = Array.from(conversionResults.converted).sort(
12+
([ruleNameA], [ruleNameB]) => ruleNameA.localeCompare(ruleNameB),
13+
);
1414

1515
for (const [ruleName, rule] of sortedRuleEntries) {
1616
output[ruleName] = formatConvertedRule(rule);

src/converters/lintConfigs/rules/ruleConverters/no-cookies.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ export const convertNoCookies: RuleConverter = () => {
77
ruleArguments: [
88
{
99
message: "Forbidden call to document.cookie",
10-
selector: 'MemberExpression[object.name="document"][property.name="cookie"]',
11-
}
10+
selector:
11+
'MemberExpression[object.name="document"][property.name="cookie"]',
12+
},
1213
],
1314
ruleName: "restricted-syntax",
1415
},

src/converters/lintConfigs/rules/ruleConverters/no-document-domain.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ export const convertNoDocumentDomain: RuleConverter = () => {
66
{
77
ruleArguments: [
88
{
9-
message: 'Forbidden write to document.domain.',
10-
selector: 'AssignmentExpression[left.type="MemberExpression"][left.object.name="document"][left.property.name="domain"]',
9+
message: "Forbidden write to document.domain.",
10+
selector:
11+
'AssignmentExpression[left.type="MemberExpression"][left.object.name="document"][left.property.name="domain"]',
1112
},
1213
{
13-
message: 'Forbidden write to document.domain.',
14-
selector: 'AssignmentExpression[left.type="MemberExpression"][left.object.type="MemberExpression"][left.object.object.name="window"][left.object.property.name="document"][left.property.name="domain"]',
14+
message: "Forbidden write to document.domain.",
15+
selector:
16+
'AssignmentExpression[left.type="MemberExpression"][left.object.type="MemberExpression"][left.object.object.name="window"][left.object.property.name="document"][left.property.name="domain"]',
1517
},
1618
],
1719
ruleName: "no-restricted-syntax",

src/converters/lintConfigs/rules/ruleConverters/no-document-write.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ export const convertNoDocumentWrite: RuleConverter = () => {
66
{
77
ruleArguments: [
88
{
9-
message: 'Forbidden call to document.write.',
10-
selector: 'CallExpression[callee.type="MemberExpression"][callee.object.name="document"][callee.property.name=/^(write|writeln)$/]',
9+
message: "Forbidden call to document.write.",
10+
selector:
11+
'CallExpression[callee.type="MemberExpression"][callee.object.name="document"][callee.property.name=/^(write|writeln)$/]',
1112
},
1213
{
13-
message: 'Forbidden write to document.write.',
14-
selector: 'CallExpression[callee.type="MemberExpression"][callee.object.type="MemberExpression"][callee.object.object.name="window"][callee.object.property.name="document"][callee.property.name=/^(write|writeln)$/]',
14+
message: "Forbidden write to document.write.",
15+
selector:
16+
'CallExpression[callee.type="MemberExpression"][callee.object.type="MemberExpression"][callee.object.object.name="window"][callee.object.property.name="document"][callee.property.name=/^(write|writeln)$/]',
1517
},
1618
],
1719
ruleName: "no-restricted-syntax",

src/converters/lintConfigs/rules/ruleConverters/no-exec-script.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const convertNoExecScript: RuleConverter = () => {
88
{
99
message: "Forbidden call to execScript",
1010
selector: 'CallExpression[callee.name="execScript"]',
11-
}
11+
},
1212
],
1313
ruleName: "restricted-syntax",
1414
},

src/converters/lintConfigs/rules/ruleConverters/react-a11y-accessible-headings.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { RuleConverter } from "../ruleConverter";
22

33
export const convertReactA11yAccessibleHeadings: RuleConverter = (tslintRule) => {
44
return {
5-
...tslintRule.ruleArguments.length === 1 && { notices: ["jsx-a11y/heading-has-content rule does not support maxHeadingLength"] },
5+
...(tslintRule.ruleArguments.length === 1 && {
6+
notices: ["jsx-a11y/heading-has-content rule does not support maxHeadingLength"],
7+
}),
68
plugins: ["jsx-a11y"],
79
rules: [
810
{

0 commit comments

Comments
 (0)