Skip to content

Commit 1addba6

Browse files
committed
chore: Fixed/ignored lint errors
1 parent 9b4e163 commit 1addba6

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

examples/bin/test.mjs

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
#!/usr/bin/env node
1+
/* eslint-disable n/no-process-exit, unicorn/no-process-exit */
2+
import { spawn } from 'node:child_process';
3+
import fs from 'node:fs/promises';
4+
import path from 'node:path';
5+
26
import chalk from 'chalk';
3-
import { spawn } from 'child_process';
4-
import fs from 'fs/promises';
5-
import path from 'path';
67

78
const debug = process.argv.includes('--debug');
89

@@ -14,21 +15,21 @@ const logDebug = (message) => {
1415

1516
const newLine = () => console.log();
1617

17-
const inputDir = './input';
18-
const expectedOutputDir = './expected-output';
18+
const inputDirectory = './input';
19+
const expectedOutputDirectory = './expected-output';
1920

2021
// NOTE: Run with `--debug` to get debug output (from both this script and prettier)
2122
const run = async () => {
2223
logDebug('Reading input directory...');
2324

2425
try {
25-
const inputFiles = await fs.readdir(inputDir);
26+
const inputFiles = await fs.readdir(inputDirectory);
2627
const originalFiles = new Map();
2728

2829
logDebug('Backing up input files...');
2930
for (const file of inputFiles) {
30-
const filePath = path.join(inputDir, file);
31-
const fileContent = await fs.readFile(filePath, 'utf-8');
31+
const filePath = path.join(inputDirectory, file);
32+
const fileContent = await fs.readFile(filePath, 'utf8');
3233
originalFiles.set(file, fileContent);
3334
}
3435

@@ -68,13 +69,13 @@ const run = async () => {
6869
let allFilesMatch = true;
6970

7071
for (const file of inputFiles) {
71-
const inputFilePath = path.join(inputDir, file);
72-
const expectedOutputFilePath = path.join(expectedOutputDir, file);
72+
const inputFilePath = path.join(inputDirectory, file);
73+
const expectedOutputFilePath = path.join(expectedOutputDirectory, file);
7374

7475
try {
7576
const [inputContent, expectedOutputContent] = await Promise.all([
76-
fs.readFile(inputFilePath, 'utf-8'),
77-
fs.readFile(expectedOutputFilePath, 'utf-8'),
77+
fs.readFile(inputFilePath, 'utf8'),
78+
fs.readFile(expectedOutputFilePath, 'utf8'),
7879
]);
7980

8081
if (inputContent === expectedOutputContent) {
@@ -91,8 +92,8 @@ const run = async () => {
9192
);
9293
allFilesMatch = false;
9394
}
94-
} catch (err) {
95-
console.error(chalk.red(`Error processing ${file}:`), err);
95+
} catch (error) {
96+
console.error(chalk.red(`Error processing ${file}:`), error);
9697
allFilesMatch = false;
9798
}
9899
}
@@ -107,8 +108,8 @@ const run = async () => {
107108
process.exit(1);
108109
}
109110
});
110-
} catch (err) {
111-
console.error(chalk.red('💩 Error:'), err);
111+
} catch (error) {
112+
console.error(chalk.red('💩 Error:'), error);
112113
process.exit(2);
113114
}
114115
};

src/parse/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ function convertAst(ast: File, templates: Template[]): void {
3434
enter(path) {
3535
const { node } = path;
3636

37-
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
3837
switch (node.type) {
3938
case 'BlockStatement':
4039
case 'ObjectExpression':

tests/cases/gts/complex.gts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default class ProjectStatusComponent extends Component<ProjectStatusSig>
2828
</Button>
2929
</template>
3030

31-
@service private declare server: ServerService;
31+
@service declare private server: ServerService;
3232

3333
private get iconType(): 'mini' {
3434
return 'mini';

tests/unit-tests/__snapshots__/format.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export default class ProjectStatusComponent extends Component<ProjectStatusSig>
326326
</Button>
327327
</template>
328328
329-
@service private declare server: ServerService;
329+
@service declare private server: ServerService;
330330
331331
private get iconType(): "mini" {
332332
return "mini";

tests/unit-tests/config/__snapshots__/semi-false.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export default class ProjectStatusComponent extends Component<ProjectStatusSig>
326326
</Button>
327327
</template>
328328
329-
@service private declare server: ServerService
329+
@service declare private server: ServerService
330330
331331
private get iconType(): "mini" {
332332
return "mini"

tests/unit-tests/config/__snapshots__/template-export-default.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export default class ProjectStatusComponent extends Component<ProjectStatusSig>
326326
</Button>
327327
</template>
328328
329-
@service private declare server: ServerService;
329+
@service declare private server: ServerService;
330330
331331
private get iconType(): "mini" {
332332
return "mini";

0 commit comments

Comments
 (0)