Skip to content

Commit

Permalink
feat: update astro plugin to v1.0 (#492)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <[email protected]>
  • Loading branch information
tinchoz49 and antfu authored Jun 2, 2024
1 parent 710661b commit 49a9d0c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 13 deletions.
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

0 comments on commit 49a9d0c

Please sign in to comment.