diff --git a/package.json b/package.json index c4d46060..0d6b4307 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "api": "pnpm --filter @yd/api -- ", "web": "pnpm --filter @yd/web -- ", "client": "pnpm --filter @yd/client -- ", + "cfg": "pnpm --filter @yd/config -- ", "ui": "pnpm --filter @yd/ui -- ", "build": "pnpm -r build", "lint": "pnpm -r lint", diff --git a/packages/config/.eslintrc.cjs b/packages/config/.eslintrc.cjs new file mode 100644 index 00000000..a21f39f2 --- /dev/null +++ b/packages/config/.eslintrc.cjs @@ -0,0 +1,4 @@ +/** @type {import('eslint').Linter.Config} */ +module.exports = { + extends: [require.resolve('./eslint/typescript')] +}; diff --git a/packages/config/eslint/svelte.js b/packages/config/eslint/svelte.js index 48e880af..ca486bd4 100644 --- a/packages/config/eslint/svelte.js +++ b/packages/config/eslint/svelte.js @@ -1,9 +1,6 @@ /** @type {import('eslint').Linter.Config} */ module.exports = { - extends: [ - require.resolve('./typescript.js'), - 'plugin:svelte/recommended', - ], + extends: [require.resolve('./typescript.js'), 'plugin:svelte/recommended'], parserOptions: { extraFileExtensions: ['.svelte'] }, diff --git a/packages/config/eslint/typescript.js b/packages/config/eslint/typescript.js index 314c157b..acf97063 100644 --- a/packages/config/eslint/typescript.js +++ b/packages/config/eslint/typescript.js @@ -1,15 +1,11 @@ /** @type {import('eslint').Linter.Config} */ module.exports = { - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'prettier' - ], + extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], parser: '@typescript-eslint/parser', plugins: ['@typescript-eslint'], parserOptions: { sourceType: 'module', - ecmaVersion: 2020, + ecmaVersion: 2020 }, env: { browser: true, diff --git a/packages/config/package.json b/packages/config/package.json index ac202b36..a289a4a0 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,25 +1,29 @@ { - "name": "@yd/config", - "private": true, - "version": "1.0.0", - "license": "MIT", - "exports": { - "./tailwind": "./tailwind.config.js", - "./eslint/typescript": "./eslint/typescript.js", - "./eslint/svelte": "./eslint/svelte.js", + "name": "@yd/config", + "private": true, + "version": "1.0.0", + "license": "MIT", + "exports": { + "./tailwind": "./tailwind.config.js", + "./eslint/typescript": "./eslint/typescript.js", + "./eslint/svelte": "./eslint/svelte.js", "./prettier": "./prettier/index.js", - "./typescript": "./typescript.json" - }, - "scripts": {}, - "devDependencies": { - "@typescript-eslint/eslint-plugin": "^6.6.0", - "@typescript-eslint/parser": "^6.6.0", - "eslint": "^8.48.0", - "eslint-config-prettier": "^9.0.0", - "eslint-plugin-svelte": "^2.33.0", - "prettier": "^3.0.3", - "prettier-plugin-svelte": "^3.0.3", - "prettier-plugin-tailwindcss": "^0.5.4", - "tailwindcss": "^3.3.3" - } + "./typescript": "./typescript.json" + }, + "prettier": "./prettier", + "scripts": { + "lint": "prettier --check . && eslint .", + "format": "prettier --write ." + }, + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^6.6.0", + "@typescript-eslint/parser": "^6.6.0", + "eslint": "^8.48.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-svelte": "^2.33.0", + "prettier": "^3.0.3", + "prettier-plugin-svelte": "^3.0.3", + "prettier-plugin-tailwindcss": "^0.5.4", + "tailwindcss": "^3.3.3" + } } diff --git a/packages/config/prettier/index.js b/packages/config/prettier/index.js index 748cec76..dc1d2627 100644 --- a/packages/config/prettier/index.js +++ b/packages/config/prettier/index.js @@ -2,8 +2,8 @@ module.exports = { useTabs: true, singleQuote: true, - trailingComma: "none", - printWidth: 100, - plugins: ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"], - overrides: [{ "files": "*.svelte", "options": { "parser": "svelte" } }] + trailingComma: 'none', + printWidth: 100, + plugins: ['prettier-plugin-svelte', 'prettier-plugin-tailwindcss'], + overrides: [{ files: '*.svelte', options: { parser: 'svelte' } }] }; diff --git a/packages/config/tailwind.config.js b/packages/config/tailwind.config.js index b67e2b84..0a62ffbb 100644 --- a/packages/config/tailwind.config.js +++ b/packages/config/tailwind.config.js @@ -1,10 +1,10 @@ /** @type {import('tailwindcss').Config} */ export default { content: [ - './src/**/*.{html,js,svelte,ts}', - '../../apps/*/src/**/*.{html,js,svelte,ts}', - '../../packages/*/src/**/*.{html,js,svelte,ts}' - ], + './src/**/*.{html,js,svelte,ts}', + '../../apps/*/src/**/*.{html,js,svelte,ts}', + '../../packages/*/src/**/*.{html,js,svelte,ts}' + ], darkMode: 'class', theme: { extend: {