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

feat: update astro plugin to v1.0 #492

Merged
merged 2 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fixtures/input/astro.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const content = "hi!";


<script>
let { log: logger } = console
document.querySelector('h1')?.addEventListener('click', () => {
alert('hi!');
logger('clicked');
});

</script>
8 changes: 4 additions & 4 deletions fixtures/output/all/astro.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const content = 'hi!';


<script>
document.querySelector('h1')?.addEventListener('click', () => {
alert('hi!');
});

const { log: logger } = console
document.querySelector('h1')?.addEventListener('click', () => {
logger('clicked')
})
</script>
8 changes: 4 additions & 4 deletions fixtures/output/with-formatters/astro.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const content = 'hi!';


<script>
document.querySelector('h1')?.addEventListener('click', () => {
alert('hi!');
});

const { log: logger } = console
document.querySelector('h1')?.addEventListener('click', () => {
logger('clicked')
})
</script>
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"@eslint-react/eslint-plugin": "^1.5.8",
"@prettier/plugin-xml": "^3.4.1",
"@unocss/eslint-plugin": ">=0.50.0",
"astro-eslint-parser": "^0.16.3",
"astro-eslint-parser": "^1.0.2",
"eslint": ">=8.40.0",
"eslint-plugin-astro": "^0.31.4",
"eslint-plugin-astro": "^1.2.0",
"eslint-plugin-format": ">=0.1.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.4",
Expand Down
14 changes: 13 additions & 1 deletion src/configs/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,28 @@ export async function astro(
{
files,
languageOptions: {
globals: pluginAstro.environments.astro.globals,
parser: parserAstro,
parserOptions: {
extraFileExtensions: ['.astro'],
parser: parserTs as any,
parser: parserTs,
},
sourceType: 'module',
},
name: 'antfu/astro/rules',
processor: 'astro/client-side-ts',
rules: {
// use recommended rules
'astro/missing-client-only-directive-value': 'error',
'astro/no-conflict-set-directives': 'error',
'astro/no-deprecated-astro-canonicalurl': 'error',
'astro/no-deprecated-astro-fetchcontent': 'error',
'astro/no-deprecated-astro-resolve': 'error',
'astro/no-deprecated-getentrybyslug': 'error',
'astro/no-set-html-directive': 'off',
'astro/no-unused-define-vars-in-style': 'error',
'astro/semi': 'off',
'astro/valid-compile': 'error',

...stylistic
? {
Expand Down
Loading