Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lint rule for implicit is:inline on script tags. #970

Merged
merged 16 commits into from
Feb 21, 2024
Prev Previous commit
Next Next commit
add test
  • Loading branch information
lilnasy committed Feb 16, 2024
commit 4dd0e4f43a862c4e3c05cfc0b7a0f306e6b4133d
19 changes: 19 additions & 0 deletions packages/compiler/test/scripts/isinline-hint.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { test } from 'uvu';
import * as assert from 'uvu/assert';
import { transform } from '@astrojs/compiler';

const FIXTURE = `
<script type="module"></script>
`;

let result;
test.before(async () => {
result = await transform(FIXTURE);
});

test('reports a hint for adding attributes to a script tag without is:inline', () => {
assert.equal(result.diagnostics[0].severity, 4);
assert.match(result.diagnostics[0].text, /Astro processes your script tags to allow using TypeScript and NPM packages/);
});

test.run();
Loading