Skip to content

Commit

Permalink
feat(config): run eslint and prettier on config package
Browse files Browse the repository at this point in the history
Signed-off-by: Jordan Shatford <[email protected]>
  • Loading branch information
jordanshatford committed Sep 11, 2023
1 parent 15d9bc7 commit 820d2ed
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 40 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/config/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: [require.resolve('./eslint/typescript')]
};
5 changes: 1 addition & 4 deletions packages/config/eslint/svelte.js
Original file line number Diff line number Diff line change
@@ -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']
},
Expand Down
8 changes: 2 additions & 6 deletions packages/config/eslint/typescript.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
48 changes: 26 additions & 22 deletions packages/config/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
8 changes: 4 additions & 4 deletions packages/config/prettier/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' } }]
};
8 changes: 4 additions & 4 deletions packages/config/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down

1 comment on commit 820d2ed

@vercel
Copy link

@vercel vercel bot commented on 820d2ed Sep 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.