Merge pull request #415 from JuliusBairaktaris/main
ESLint V9 Migration, Package Updates, and Code Improvements
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
dist
|
||||
node_modules
|
||||
.github
|
||||
types.generated.d.ts
|
53
.eslintrc.js
53
.eslintrc.js
@@ -1,53 +0,0 @@
|
||||
/** @type {import("eslint").Linter.Config} */
|
||||
module.exports = {
|
||||
env: {
|
||||
node: true,
|
||||
es2022: true,
|
||||
browser: true,
|
||||
},
|
||||
extends: ['eslint:recommended', 'plugin:astro/recommended'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
},
|
||||
rules: {},
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.js'],
|
||||
rules: {
|
||||
'no-mixed-spaces-and-tabs': ['error', 'smart-tabs'],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['*.astro'],
|
||||
parser: 'astro-eslint-parser',
|
||||
parserOptions: {
|
||||
parser: '@typescript-eslint/parser',
|
||||
extraFileExtensions: ['.astro'],
|
||||
},
|
||||
rules: {
|
||||
'no-mixed-spaces-and-tabs': ['error', 'smart-tabs'],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['*.ts'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
extends: ['plugin:@typescript-eslint/recommended'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{ argsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' },
|
||||
],
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
// Define the configuration for `<script>` tag.
|
||||
// Script in `<script>` is assigned a virtual file name with the `.js` extension.
|
||||
files: ['**/*.astro/*.js', '*.astro/*.js'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
},
|
||||
],
|
||||
};
|
@@ -8,7 +8,7 @@ import tailwind from '@astrojs/tailwind';
|
||||
import mdx from '@astrojs/mdx';
|
||||
import partytown from '@astrojs/partytown';
|
||||
import icon from 'astro-icon';
|
||||
import compress from 'astro-compress';
|
||||
import compress from '@playform/compress';
|
||||
|
||||
import astrowind from './src/integration';
|
||||
|
||||
|
58
eslint.config.js
Normal file
58
eslint.config.js
Normal file
@@ -0,0 +1,58 @@
|
||||
import astroEslintParser from 'astro-eslint-parser';
|
||||
import eslintPluginAstro from 'eslint-plugin-astro';
|
||||
import globals from 'globals';
|
||||
import js from '@eslint/js';
|
||||
import tseslint from 'typescript-eslint';
|
||||
import typescriptParser from '@typescript-eslint/parser';
|
||||
|
||||
export default [
|
||||
js.configs.recommended,
|
||||
...eslintPluginAstro.configs['flat/recommended'],
|
||||
...tseslint.configs.recommended,
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.astro'],
|
||||
languageOptions: {
|
||||
parser: astroEslintParser,
|
||||
parserOptions: {
|
||||
parser: '@typescript-eslint/parser',
|
||||
extraFileExtensions: ['.astro'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.{js,jsx,astro}'],
|
||||
rules: {
|
||||
'no-mixed-spaces-and-tabs': ['error', 'smart-tabs'],
|
||||
},
|
||||
},
|
||||
{
|
||||
// Define the configuration for `<script>` tag.
|
||||
// Script in `<script>` is assigned a virtual file name with the `.js` extension.
|
||||
files: ['**/*.{ts,tsx}', '**/*.astro/*.js'],
|
||||
languageOptions: {
|
||||
parser: typescriptParser,
|
||||
},
|
||||
rules: {
|
||||
// Note: you must disable the base rule as it can report incorrect errors
|
||||
'no-unused-vars': 'off',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
argsIgnorePattern: '^_',
|
||||
destructuredArrayIgnorePattern: '^_',
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
ignores: ['dist', 'node_modules', '.github', 'types.generated.d.ts'],
|
||||
},
|
||||
];
|
2749
package-lock.json
generated
2749
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
33
package.json
33
package.json
@@ -1,8 +1,12 @@
|
||||
{
|
||||
"name": "@onwidget/astrowind",
|
||||
"description": "AstroWind: A free template using Astro 4.0 and Tailwind CSS. Astro starter theme.",
|
||||
"version": "1.0.0-beta.22",
|
||||
"description": "AstroWind: A free template using Astro 4.0 and Tailwind CSS. Astro starter theme.",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": ">=18.20.2"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "astro dev",
|
||||
"start": "astro dev",
|
||||
@@ -10,7 +14,7 @@
|
||||
"preview": "astro preview",
|
||||
"astro": "astro",
|
||||
"format": "prettier -w .",
|
||||
"lint:eslint": "eslint . --ext .js,.ts,.astro"
|
||||
"lint:eslint": "eslint ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/rss": "^4.0.5",
|
||||
@@ -18,27 +22,30 @@
|
||||
"@astrolib/analytics": "^0.5.0",
|
||||
"@astrolib/seo": "^1.0.0-beta.5",
|
||||
"@fontsource-variable/inter": "^5.0.17",
|
||||
"astro": "^4.5.15",
|
||||
"astro": "^4.5.16",
|
||||
"astro-icon": "^1.1.0",
|
||||
"limax": "4.1.0",
|
||||
"lodash.merge": "^4.6.2",
|
||||
"unpic": "^3.18.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@astrojs/mdx": "^2.2.3",
|
||||
"@astrojs/mdx": "^2.2.4",
|
||||
"@astrojs/partytown": "^2.0.4",
|
||||
"@astrojs/tailwind": "5.1.0",
|
||||
"@eslint/js": "^9.0.0",
|
||||
"@iconify-json/flat-color-icons": "^1.1.10",
|
||||
"@iconify-json/tabler": "^1.1.109",
|
||||
"@playform/compress": "0.0.3",
|
||||
"@tailwindcss/typography": "^0.5.12",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/lodash.merge": "^4.6.9",
|
||||
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
||||
"@typescript-eslint/parser": "^7.5.0",
|
||||
"astro-compress": "2.2.21",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-astro": "^0.33.1",
|
||||
"@typescript-eslint/eslint-plugin": "^7.6.0",
|
||||
"@typescript-eslint/parser": "^7.6.0",
|
||||
"astro-eslint-parser": "^0.17.0",
|
||||
"eslint": "^9.0.0",
|
||||
"eslint-plugin-astro": "^0.34.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.8.0",
|
||||
"globals": "^15.0.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"mdast-util-to-string": "^4.0.0",
|
||||
"prettier": "^3.2.5",
|
||||
@@ -48,9 +55,7 @@
|
||||
"sharp": "0.33.3",
|
||||
"tailwind-merge": "^2.2.2",
|
||||
"tailwindcss": "^3.4.3",
|
||||
"typescript": "^5.4.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.14.1"
|
||||
"typescript": "^5.4.4",
|
||||
"typescript-eslint": "^7.6.0"
|
||||
}
|
||||
}
|
||||
}
|
@@ -105,7 +105,7 @@ import { UI } from 'astrowind:config';
|
||||
newlink.click();
|
||||
});
|
||||
|
||||
let screenSize = window.matchMedia('(max-width: 767px)');
|
||||
const screenSize = window.matchMedia('(max-width: 767px)');
|
||||
screenSize.addEventListener('change', function () {
|
||||
document.querySelector('[data-aw-toggle-menu]')?.classList.remove('expanded');
|
||||
document.body.classList.remove('overflow-hidden');
|
||||
|
Reference in New Issue
Block a user