From 7aa64366c0aa9cad23ca56453592f7ae588616b4 Mon Sep 17 00:00:00 2001 From: Jorge Vargas Date: Wed, 18 Sep 2024 19:44:37 -0600 Subject: [PATCH] Simplify linter & formatter config --- .eslintrc.cjs | 33 ++++++++++----------------------- package.json | 23 +++++++++-------------- prettier.config.cjs | 12 +++++++----- tsconfig.json | 9 --------- 4 files changed, 26 insertions(+), 51 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 567854e..82f9241 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -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} */ -module.exports = { - extends: ['plugin:astro/recommended'], - parser: '@typescript-eslint/parser', - parserOptions: { - 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 }] - } -} +module.exports = [ + eslintConfigStandard, + eslintConfigPrettier, + eslintPluginAstro.configs.recommended +] diff --git a/package.json b/package.json index 5b46006..61ddbf2 100644 --- a/package.json +++ b/package.json @@ -28,29 +28,24 @@ "@inlang/paraglide-astro": "^0.2.2", "@sequelize/core": "^7.0.0-alpha.37", "@sequelize/mysql": "^7.0.0-alpha.41", - "astro": "^4.13.1", - "astro-icon": "^1.1.1", - "auth-astro": "^4.1.2", + "lodash": "^4.17.21", "bcrypt": "^5.1.1", "graphql-scalars": "^1.23.0", - "sharp": "0.32.6", - "tailwindcss": "^3.4.8" + "tailwindcss": "^3.4.12", + "typescript": "^5.6.2" }, "devDependencies": { "@inlang/paraglide-js": "1.11.2", "@parcel/watcher": "^2.4.1", "@types/bcrypt": "^5.0.2", - "@typescript-eslint/parser": "^6.21.0", + "@typescript-eslint/parser": "^8.6.0", "concurrently": "^8.2.2", - "eslint": "^8.57.0", - "eslint-plugin-astro": "^1.2.3", - "eslint-plugin-jsx-a11y": "^6.9.0", + "eslint": "^9.10.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-astro": "^1.2.4", + "eslint-plugin-jsx-a11y": "^6.10.0", "prettier": "^3.3.3", "prettier-config-standard": "^7.0.0", - "prettier-plugin-astro": "^0.14.1", - "typescript": "^5.5.4" - }, - "optionalDependencies": { - "@rollup/rollup-linux-x64-gnu": "4.9.5" + "prettier-plugin-astro": "^0.14.1" } } \ No newline at end of file diff --git a/prettier.config.cjs b/prettier.config.cjs index ccfd1d2..20fb506 100644 --- a/prettier.config.cjs +++ b/prettier.config.cjs @@ -1,8 +1,8 @@ -/** @type {import("prettier").Config} */ -module.exports = { - ...require('prettier-config-standard'), +const merge = require('lodash/merge') +const prettierConfigStandard = require('prettier-config-standard') - pluginSearchDirs: [__dirname], +/** @type {import("prettier").Config} */ +const config = merge(prettierConfigStandard, { plugins: [require.resolve('prettier-plugin-astro')], overrides: [ { @@ -12,4 +12,6 @@ module.exports = { } } ] -} +}) + +module.exports = config diff --git a/tsconfig.json b/tsconfig.json index ccfca88..f898b1e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,17 +1,8 @@ { "extends": "astro/tsconfigs/strict", "compilerOptions": { - "experimentalDecorators": true, "moduleResolution": "Bundler", "allowJs": true, "baseUrl": "src", - "paths": { - "@/*": [ - "*" - ], - "@/root/*": [ - "../*" - ] - } } } \ No newline at end of file