Skip to content

Commit

Permalink
lint:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Jun 21, 2024
1 parent 313f2e1 commit d8eb1ad
Show file tree
Hide file tree
Showing 109 changed files with 710 additions and 702 deletions.
18 changes: 9 additions & 9 deletions packages/core/__tests__/cli/build-watch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe.skip('CLI: watched build mode typechecking', () => {
let stripped = stripAnsi(output);
let error = stripped.slice(
stripped.indexOf('index.gts'),
stripped.lastIndexOf(`~~~${os.EOL}`) + 3
stripped.lastIndexOf(`~~~${os.EOL}`) + 3,
);

expect(output).toMatch('Found 1 error.');
Expand Down Expand Up @@ -154,7 +154,7 @@ describe.skip('CLI: watched build mode typechecking', () => {
let stripped = stripAnsi(output);
let error = stripped.slice(
stripped.indexOf('index.gts'),
stripped.lastIndexOf(`~~~${os.EOL}`) + 3
stripped.lastIndexOf(`~~~${os.EOL}`) + 3,
);

expect(output).toMatch('Found 1 error.');
Expand Down Expand Up @@ -349,14 +349,14 @@ describe.skip('CLI: watched build mode typechecking', () => {

projects.main.write(
INPUT_SFC,
mainCode.replace('{{this.startupTime}}', '{{this.startupTime}')
mainCode.replace('{{this.startupTime}}', '{{this.startupTime}'),
);

output = await watch.awaitOutput('Parse error');
let stripped = stripAnsi(output);
let error = stripped.slice(
stripped.indexOf('index.gts'),
stripped.lastIndexOf(`~~~${os.EOL}`) + 3
stripped.lastIndexOf(`~~~${os.EOL}`) + 3,
);
expect(error).toMatchInlineSnapshot(`
"index.gts:14:32 - error TS0: Parse error on line 3:
Expand Down Expand Up @@ -392,7 +392,7 @@ describe.skip('CLI: watched build mode typechecking', () => {
let stripped = stripAnsi(output);
let error = stripped.slice(
stripped.indexOf('index.gts'),
stripped.lastIndexOf(`;${os.EOL}`) + 1
stripped.lastIndexOf(`;${os.EOL}`) + 1,
);
expect(error).toMatchInlineSnapshot(`
"index.gts:3:28 - error TS0: Unclosed element \`C\`:
Expand Down Expand Up @@ -430,7 +430,7 @@ describe.skip('CLI: watched build mode typechecking', () => {
let stripped = stripAnsi(output);
let error = stripped.slice(
stripped.indexOf('index.gts'),
stripped.lastIndexOf(`~~~${os.EOL}`) + 3
stripped.lastIndexOf(`~~~${os.EOL}`) + 3,
);
expect(error).toMatchInlineSnapshot(`
"index.gts:3:31 - error TS0: Parse error on line 1:
Expand Down Expand Up @@ -468,7 +468,7 @@ describe.skip('CLI: watched build mode typechecking', () => {
let stripped = stripAnsi(output);
let error = stripped.slice(
stripped.indexOf('index.gts'),
stripped.lastIndexOf(`~~~${os.EOL}`) + 3
stripped.lastIndexOf(`~~~${os.EOL}`) + 3,
);
expect(error).toMatchInlineSnapshot(`
"index.gts:15:5 - error TS2554: Expected 0 arguments, but got 1.
Expand Down Expand Up @@ -501,7 +501,7 @@ describe.skip('CLI: watched build mode typechecking', () => {
let stripped = stripAnsi(output);
let error = stripped.slice(
stripped.indexOf('index.gts'),
stripped.lastIndexOf(`~~~${os.EOL}`) + 3
stripped.lastIndexOf(`~~~${os.EOL}`) + 3,
);
expect(error).toMatchInlineSnapshot(`
"index.gts:3:28 - error TS2554: Expected 0 arguments, but got 1.
Expand Down Expand Up @@ -534,7 +534,7 @@ describe.skip('CLI: watched build mode typechecking', () => {
let stripped = stripAnsi(output);
let error = stripped.slice(
stripped.indexOf('index.gts'),
stripped.lastIndexOf(`~~~${os.EOL}`) + 3
stripped.lastIndexOf(`~~~${os.EOL}`) + 3,
);
expect(error).toMatchInlineSnapshot(`
"index.gts:3:27 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
Expand Down
46 changes: 23 additions & 23 deletions packages/core/__tests__/cli/build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ describe.skip('CLI: --build --dry', () => {
let buildResult = await project.build({ flags: ['--dry'] });
expect(buildResult.exitCode).toBe(0);
expect(stripAnsi(buildResult.stdout)).toMatch(
`A non-dry build would build project '${project.filePath('tsconfig.json')}'`
`A non-dry build would build project '${project.filePath('tsconfig.json')}'`,
);
expect(buildResult.stderr).toEqual('');
});
Expand All @@ -1321,7 +1321,7 @@ describe.skip('CLI: --build --dry', () => {
let buildResult = await project.build({ flags: ['--dry'] });
expect(buildResult.exitCode).toBe(0);
expect(stripAnsi(buildResult.stdout)).toMatch(
`Project '${project.filePath('tsconfig.json')}' is up to date`
`Project '${project.filePath('tsconfig.json')}' is up to date`,
);
expect(buildResult.stderr).toEqual('');
});
Expand Down Expand Up @@ -1350,7 +1350,7 @@ describe.skip('CLI: --build --dry', () => {
let buildResult = await project.build({ flags: ['--dry'] });
expect(buildResult.exitCode).toBe(0);
expect(stripAnsi(buildResult.stdout)).toMatch(
`A non-dry build would build project '${project.filePath('tsconfig.json')}'`
`A non-dry build would build project '${project.filePath('tsconfig.json')}'`,
);
expect(buildResult.stderr).toEqual('');
});
Expand Down Expand Up @@ -1391,7 +1391,7 @@ describe.skip('CLI: --build --dry', () => {
let buildResult = await project.build({ flags: ['--dry'] });
expect(buildResult.exitCode).toBe(0);
expect(stripAnsi(buildResult.stdout)).toMatch(
`A non-dry build would build project '${project.filePath('tsconfig.json')}'`
`A non-dry build would build project '${project.filePath('tsconfig.json')}'`,
);
expect(buildResult.stderr).toEqual('');
});
Expand All @@ -1405,7 +1405,7 @@ describe.skip('CLI: --build --dry', () => {
let buildResult = await project.build({ flags: ['--dry'] });
expect(buildResult.exitCode).toBe(0);
expect(stripAnsi(buildResult.stdout)).toMatch(
`Project '${project.filePath('tsconfig.json')}' is up to date`
`Project '${project.filePath('tsconfig.json')}' is up to date`,
);
expect(buildResult.stderr).toEqual('');
});
Expand All @@ -1429,7 +1429,7 @@ describe.skip('CLI: --build --dry', () => {
let buildResult = await project.build({ flags: ['--dry'] });
expect(buildResult.exitCode).toBe(0);
expect(stripAnsi(buildResult.stdout)).toMatch(
`A non-dry build would build project '${project.filePath('tsconfig.json')}'`
`A non-dry build would build project '${project.filePath('tsconfig.json')}'`,
);
expect(buildResult.stderr).toEqual('');
});
Expand All @@ -1445,7 +1445,7 @@ describe.skip('CLI: --build --dry', () => {
let buildResult = await project.build({ flags: ['--dry'] });
expect(buildResult.exitCode).toBe(0);
expect(stripAnsi(buildResult.stdout)).toMatch(
`A non-dry build would build project '${project.filePath('tsconfig.json')}'`
`A non-dry build would build project '${project.filePath('tsconfig.json')}'`,
);
expect(buildResult.stderr).toEqual('');
}, 2_000_000);
Expand Down Expand Up @@ -1502,16 +1502,16 @@ describe.skip('CLI: --build --dry', () => {
let buildResult = await projects.root.build({ flags: ['--dry'] });
expect(buildResult.exitCode).toBe(0);
expect(stripAnsi(buildResult.stdout)).toMatch(
`A non-dry build would build project '${projects.main.filePath('tsconfig.json')}'`
`A non-dry build would build project '${projects.main.filePath('tsconfig.json')}'`,
);
expect(stripAnsi(buildResult.stdout)).toMatch(
`A non-dry build would build project '${projects.children.a.filePath('tsconfig.json')}'`
`A non-dry build would build project '${projects.children.a.filePath('tsconfig.json')}'`,
);
expect(stripAnsi(buildResult.stdout)).toMatch(
`A non-dry build would build project '${projects.children.b.filePath('tsconfig.json')}'`
`A non-dry build would build project '${projects.children.b.filePath('tsconfig.json')}'`,
);
expect(stripAnsi(buildResult.stdout)).toMatch(
`A non-dry build would build project '${projects.children.c.filePath('tsconfig.json')}'`
`A non-dry build would build project '${projects.children.c.filePath('tsconfig.json')}'`,
);
expect(buildResult.stderr).toEqual('');
});
Expand All @@ -1525,16 +1525,16 @@ describe.skip('CLI: --build --dry', () => {
let buildResult = await projects.root.build({ flags: ['--dry'] });
expect(buildResult.exitCode).toBe(0);
expect(stripAnsi(buildResult.stdout)).toMatch(
`Project '${projects.main.filePath('tsconfig.json')}' is up to date`
`Project '${projects.main.filePath('tsconfig.json')}' is up to date`,
);
expect(stripAnsi(buildResult.stdout)).toMatch(
`Project '${projects.children.a.filePath('tsconfig.json')}' is up to date`
`Project '${projects.children.a.filePath('tsconfig.json')}' is up to date`,
);
expect(stripAnsi(buildResult.stdout)).toMatch(
`Project '${projects.children.b.filePath('tsconfig.json')}' is up to date`
`Project '${projects.children.b.filePath('tsconfig.json')}' is up to date`,
);
expect(stripAnsi(buildResult.stdout)).toMatch(
`Project '${projects.children.c.filePath('tsconfig.json')}' is up to date`
`Project '${projects.children.c.filePath('tsconfig.json')}' is up to date`,
);
expect(buildResult.stderr).toEqual('');
});
Expand Down Expand Up @@ -1564,16 +1564,16 @@ describe.skip('CLI: --build --dry', () => {
let buildResult = await projects.root.build({ flags: ['--dry'] });
expect(buildResult.exitCode).toBe(0);
expect(stripAnsi(buildResult.stdout)).toMatch(
`A non-dry build would build project '${projects.main.filePath('tsconfig.json')}'`
`A non-dry build would build project '${projects.main.filePath('tsconfig.json')}'`,
);
expect(stripAnsi(buildResult.stdout)).toMatch(
`Project '${projects.children.a.filePath('tsconfig.json')}' is up to date`
`Project '${projects.children.a.filePath('tsconfig.json')}' is up to date`,
);
expect(stripAnsi(buildResult.stdout)).toMatch(
`Project '${projects.children.b.filePath('tsconfig.json')}' is up to date`
`Project '${projects.children.b.filePath('tsconfig.json')}' is up to date`,
);
expect(stripAnsi(buildResult.stdout)).toMatch(
`Project '${projects.children.c.filePath('tsconfig.json')}' is up to date`
`Project '${projects.children.c.filePath('tsconfig.json')}' is up to date`,
);
expect(buildResult.stderr).toEqual('');
});
Expand All @@ -1589,16 +1589,16 @@ describe.skip('CLI: --build --dry', () => {
let buildResult = await projects.root.build({ flags: ['--dry'] });
expect(buildResult.exitCode).toBe(0);
expect(stripAnsi(buildResult.stdout)).toMatch(
`A non-dry build would build project '${projects.main.filePath('tsconfig.json')}'`
`A non-dry build would build project '${projects.main.filePath('tsconfig.json')}'`,
);
expect(stripAnsi(buildResult.stdout)).toMatch(
`A non-dry build would build project '${projects.children.a.filePath('tsconfig.json')}'`
`A non-dry build would build project '${projects.children.a.filePath('tsconfig.json')}'`,
);
expect(stripAnsi(buildResult.stdout)).toMatch(
`Project '${projects.children.b.filePath('tsconfig.json')}' is up to date`
`Project '${projects.children.b.filePath('tsconfig.json')}' is up to date`,
);
expect(stripAnsi(buildResult.stdout)).toMatch(
`Project '${projects.children.c.filePath('tsconfig.json')}' is up to date`
`Project '${projects.children.c.filePath('tsconfig.json')}' is up to date`,
);
expect(buildResult.stderr).toEqual('');
});
Expand Down
2 changes: 1 addition & 1 deletion packages/core/__tests__/cli/check.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ describe('CLI: single-pass typechecking', () => {
'my-component.gts',
stripIndent`
export let x: string = 123;
`
`,
);

let checkResult = await project.check({ reject: false });
Expand Down
10 changes: 5 additions & 5 deletions packages/core/__tests__/cli/custom-extensions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe.skip('CLI: custom extensions', () => {
let stripped = stripAnsi(output);
let error = stripped.slice(
stripped.indexOf('index.gts'),
stripped.lastIndexOf(`~~~${os.EOL}`) + 3
stripped.lastIndexOf(`~~~${os.EOL}`) + 3,
);

expect(output).toMatch('Found 1 error.');
Expand All @@ -68,7 +68,7 @@ describe.skip('CLI: custom extensions', () => {
stripIndent`
import { foo } from "./other";
console.log(foo - 1);
`
`,
);
});

Expand All @@ -78,7 +78,7 @@ describe.skip('CLI: custom extensions', () => {

expect(output).toMatch('Found 1 error.');
expect(output).toMatch(
"Cannot find module './other' or its corresponding type declarations."
"Cannot find module './other' or its corresponding type declarations.",
);

project.write('other.gjs', 'export const foo = 123;');
Expand Down Expand Up @@ -117,7 +117,7 @@ describe.skip('CLI: custom extensions', () => {

expect(output).toMatch('Found 1 error.');
expect(output).toMatch(
"Cannot find module './other' or its corresponding type declarations."
"Cannot find module './other' or its corresponding type declarations.",
);

await watch.terminate();
Expand Down Expand Up @@ -163,7 +163,7 @@ describe.skip('CLI: custom extensions', () => {

expect(result.exitCode).toBe(0);
expect(result.stderr).toBe('');
}
},
);
});
});
4 changes: 2 additions & 2 deletions packages/core/__tests__/cli/watch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('CLI: watched typechecking', () => {
let stripped = stripAnsi(output);
let error = stripped.slice(
stripped.indexOf('index.gts'),
stripped.lastIndexOf(`~~~${os.EOL}`) + 3
stripped.lastIndexOf(`~~~${os.EOL}`) + 3,
);

expect(output).toMatch('Found 1 error.');
Expand Down Expand Up @@ -113,7 +113,7 @@ describe('CLI: watched typechecking', () => {
let stripped = stripAnsi(output);
let error = stripped.slice(
stripped.indexOf('index.gts'),
stripped.lastIndexOf(`~~~${os.EOL}`) + 3
stripped.lastIndexOf(`~~~${os.EOL}`) + 3,
);

expect(output).toMatch('Found 1 error.');
Expand Down
22 changes: 11 additions & 11 deletions packages/core/__tests__/config/environment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Config: Environments', () => {
});

expect(
env.moduleMayHaveEmbeddedTemplates('foo.ts', 'import foo from "my-cool-environment"\n')
env.moduleMayHaveEmbeddedTemplates('foo.ts', 'import foo from "my-cool-environment"\n'),
).toBe(true);
});

Expand All @@ -28,7 +28,7 @@ describe('Config: Environments', () => {
});

expect(env.moduleMayHaveEmbeddedTemplates('foo.ts', 'import foo from "another-env"\n')).toBe(
true
true,
);
});

Expand All @@ -40,7 +40,7 @@ describe('Config: Environments', () => {
});

expect(
env.moduleMayHaveEmbeddedTemplates('foo.ts', 'import { hbs } from "another-env"\n')
env.moduleMayHaveEmbeddedTemplates('foo.ts', 'import { hbs } from "another-env"\n'),
).toBe(false);
});
});
Expand Down Expand Up @@ -152,7 +152,7 @@ describe('Config: Environments', () => {
exports: {
'./glint-environment-definition': './env.js',
},
})
}),
);

let env = GlintEnvironment.load('test-env', { rootDir: testDir });
Expand All @@ -166,7 +166,7 @@ describe('Config: Environments', () => {
fs.mkdirSync(envDir, { recursive: true });
fs.writeFileSync(
`${envDir}/third-party-env.js`,
'module.exports = () => ({ tags: { hi: {} } });'
'module.exports = () => ({ tags: { hi: {} } });',
);
fs.writeFileSync(
`${envDir}/package.json`,
Expand All @@ -175,7 +175,7 @@ describe('Config: Environments', () => {
exports: {
'./glint-environment-definition': './third-party-env.js',
},
})
}),
);

let env = GlintEnvironment.load('some-other-environment', { rootDir: testDir });
Expand All @@ -189,7 +189,7 @@ describe('Config: Environments', () => {
fs.mkdirSync(envDir, { recursive: true });
fs.writeFileSync(
`${envDir}/my-internal-env.js`,
'module.exports = () => ({ tags: { internal: {} } });'
'module.exports = () => ({ tags: { internal: {} } });',
);

let env = GlintEnvironment.load('./lib/my-internal-env.js', { rootDir: testDir });
Expand All @@ -210,7 +210,7 @@ describe('Config: Environments', () => {
exports: {
'./glint-environment-definition': './env.js',
},
})
}),
);

return name;
Expand All @@ -220,7 +220,7 @@ describe('Config: Environments', () => {
test('loading compatible environments', () => {
let envA = createEnvironment('() => ({ tags: { "foo-bar": { hbs: {} } } })');
let envB = createEnvironment(
'() => ({ tags: { "foo-bar": { tpl: {} }, "baz": { hbs: {} } }, template: { typesModule: "foo" } })'
'() => ({ tags: { "foo-bar": { tpl: {} }, "baz": { hbs: {} } }, template: { typesModule: "foo" } })',
);

let env = GlintEnvironment.load([envA, envB], { rootDir: testDir });
Expand All @@ -237,7 +237,7 @@ describe('Config: Environments', () => {
let envB = createEnvironment('() => ({ template: { typesModule: "bar" } })');

expect(() => GlintEnvironment.load([envA, envB], { rootDir: testDir })).toThrow(
'Multiple configured Glint environments attempted to define behavior for standalone template files'
'Multiple configured Glint environments attempted to define behavior for standalone template files',
);
});

Expand All @@ -246,7 +246,7 @@ describe('Config: Environments', () => {
let envB = createEnvironment('() => ({ tags: { foo: { hbs: {} } } })');

expect(() => GlintEnvironment.load([envA, envB], { rootDir: testDir })).toThrow(
"Multiple configured Glint environments attempted to define behavior for the tag `hbs` in module 'foo'"
"Multiple configured Glint environments attempted to define behavior for the tag `hbs` in module 'foo'",
);
});
});
Expand Down
Loading

0 comments on commit d8eb1ad

Please sign in to comment.