added eslint for astro

This commit is contained in:
Daniel
2023-04-03 18:10:02 +05:30
parent c8869e768b
commit 93a77bb56e
8 changed files with 146 additions and 20 deletions

24
src/html/.eslintrc.json Normal file
View File

@@ -0,0 +1,24 @@
{
"root": true,
"extends": [
"plugin:astro/recommended"
],
"overrides": [
{
// Define the configuration for `.astro` file.
"files": ["*.astro"],
// Allows Astro components to be parsed.
"parser": "astro-eslint-parser",
// Parse the script in `.astro` as TypeScript by adding the following configuration.
// It's the setting you need when using TypeScript.
"parserOptions": {
"parser": "@typescript-eslint/parser",
"extraFileExtensions": [".astro"]
},
"rules": {
// override/add rules settings here, such as:
// "astro/no-set-html-directive": "error"
}
}
]
}

View File

@@ -1,3 +1,4 @@
{
"root": true,
"extends": "astro/tsconfigs/base"
}

View File

@@ -1,6 +1,7 @@
---
const { path } = Astro.props
const distPath = (path != undefined) ? path : '../../../dist'
const adminlteJsUrl = distPath + '/js/adminlte.js'
---
<!-- OPTIONAL SCRIPTS -->
<!-- overlayscrollbars -->
@@ -14,7 +15,7 @@ const distPath = (path != undefined) ? path : '../../../dist'
<!-- REQUIRED SCRIPTS -->
<!-- AdminLTE App -->
<script src={distPath + '/js/adminlte.js'}></script>
<script src={adminlteJsUrl} is:inline></script>
<!-- OPTIONAL SCRIPTS -->
<script is:inline>