Simplify linter & formatter config

This commit is contained in:
Jorge Vargas 2024-09-18 19:44:37 -06:00
parent dd23b65c80
commit 7aa64366c0
4 changed files with 26 additions and 51 deletions

View file

@ -1,24 +1,11 @@
import eslintConfigStandard from 'eslint-config-standard'
import eslintConfigPrettier from 'eslint-config-prettier'
import eslintPluginAstro from 'eslint-plugin-astro'
/** @type {import("eslint").Linter.Config} */ /** @type {import("eslint").Linter.Config} */
module.exports = { module.exports = [
extends: ['plugin:astro/recommended'], eslintConfigStandard,
parser: '@typescript-eslint/parser', eslintConfigPrettier,
parserOptions: { eslintPluginAstro.configs.recommended
tsconfigRootDir: __dirname, ]
sourceType: 'module',
ecmaVersion: 'latest'
},
overrides: [
{
files: ['*.astro'],
parser: 'astro-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.astro']
},
rules: {}
}
],
rules: {
'no-multiple-empty-lines': [2, { max: 1 }]
}
}

View file

@ -28,29 +28,24 @@
"@inlang/paraglide-astro": "^0.2.2", "@inlang/paraglide-astro": "^0.2.2",
"@sequelize/core": "^7.0.0-alpha.37", "@sequelize/core": "^7.0.0-alpha.37",
"@sequelize/mysql": "^7.0.0-alpha.41", "@sequelize/mysql": "^7.0.0-alpha.41",
"astro": "^4.13.1", "lodash": "^4.17.21",
"astro-icon": "^1.1.1",
"auth-astro": "^4.1.2",
"bcrypt": "^5.1.1", "bcrypt": "^5.1.1",
"graphql-scalars": "^1.23.0", "graphql-scalars": "^1.23.0",
"sharp": "0.32.6", "tailwindcss": "^3.4.12",
"tailwindcss": "^3.4.8" "typescript": "^5.6.2"
}, },
"devDependencies": { "devDependencies": {
"@inlang/paraglide-js": "1.11.2", "@inlang/paraglide-js": "1.11.2",
"@parcel/watcher": "^2.4.1", "@parcel/watcher": "^2.4.1",
"@types/bcrypt": "^5.0.2", "@types/bcrypt": "^5.0.2",
"@typescript-eslint/parser": "^6.21.0", "@typescript-eslint/parser": "^8.6.0",
"concurrently": "^8.2.2", "concurrently": "^8.2.2",
"eslint": "^8.57.0", "eslint": "^9.10.0",
"eslint-plugin-astro": "^1.2.3", "eslint-config-prettier": "^9.1.0",
"eslint-plugin-jsx-a11y": "^6.9.0", "eslint-plugin-astro": "^1.2.4",
"eslint-plugin-jsx-a11y": "^6.10.0",
"prettier": "^3.3.3", "prettier": "^3.3.3",
"prettier-config-standard": "^7.0.0", "prettier-config-standard": "^7.0.0",
"prettier-plugin-astro": "^0.14.1", "prettier-plugin-astro": "^0.14.1"
"typescript": "^5.5.4"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "4.9.5"
} }
} }

View file

@ -1,8 +1,8 @@
/** @type {import("prettier").Config} */ const merge = require('lodash/merge')
module.exports = { const prettierConfigStandard = require('prettier-config-standard')
...require('prettier-config-standard'),
pluginSearchDirs: [__dirname], /** @type {import("prettier").Config} */
const config = merge(prettierConfigStandard, {
plugins: [require.resolve('prettier-plugin-astro')], plugins: [require.resolve('prettier-plugin-astro')],
overrides: [ overrides: [
{ {
@ -12,4 +12,6 @@ module.exports = {
} }
} }
] ]
} })
module.exports = config

View file

@ -1,17 +1,8 @@
{ {
"extends": "astro/tsconfigs/strict", "extends": "astro/tsconfigs/strict",
"compilerOptions": { "compilerOptions": {
"experimentalDecorators": true,
"moduleResolution": "Bundler", "moduleResolution": "Bundler",
"allowJs": true, "allowJs": true,
"baseUrl": "src", "baseUrl": "src",
"paths": {
"@/*": [
"*"
],
"@/root/*": [
"../*"
]
}
} }
} }