Skip to content

Commit

Permalink
feat(yarn): split configs, update prettier config
Browse files Browse the repository at this point in the history
  • Loading branch information
FradSer committed Mar 2, 2023
1 parent f1d0475 commit d844d0b
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/.next
**/.vscode
6 changes: 6 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: ['next', 'next/core-web-vitals'],
rules: {
'@next/next/no-img-element': 'off',
},
}
29 changes: 2 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"format": "prettier --write \"**/*.{js,ts,tsx,md,mdx,json}\"",
"release": "release-it"
},
"dependencies": {
Expand All @@ -39,6 +40,7 @@
},
"devDependencies": {
"@release-it/conventional-changelog": "^5.1.1",
"@serverless-guru/prettier-plugin-import-order": "^0.4.1",
"@types/lodash": "^4.14.191",
"@types/node": "^18.11.18",
"@types/react": "^18.0.26",
Expand All @@ -55,32 +57,5 @@
"release-it": "^15.6.0",
"tailwindcss": "^3.2.4",
"typescript": "^4.9.4"
},
"prettier": {
"parser": "typescript",
"tabWidth": 2,
"singleQuote": true,
"printWidth": 80,
"semi": true,
"overrides": [
{
"files": ["*.json"],
"options": {
"parser": "json"
}
},
{
"files": ["*.mdx"],
"options": {
"parser": "mdx"
}
}
]
},
"eslintConfig": {
"extends": ["next", "next/core-web-vitals"],
"rules": {
"@next/next/no-img-element": "off"
}
}
}
39 changes: 39 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
parser: 'typescript',
arrowParens: 'always',
singleQuote: true,
tabWidth: 2,
printWidth: 80,
semi: false,
overrides: [
{
files: ['*.json'],
options: {
parser: 'json',
},
},
{
files: ['*.md', '*.mdx'],
options: {
parser: 'markdown',
},
},
],
importOrder: [
'^react$',
'^next$',
'^@next$',
'<THIRD_PARTY_MODULES>',
'^[./]',
'^@/pages/(.*)$',
'^@/components/(.*)$',
'^@/utils/(.*)$',
'^@/styles/(.*)$',
],
importOrderSeparation: true,
importOrderTypeImportsToBottom: true,
plugins: [
require('prettier-plugin-tailwindcss'),
require('@serverless-guru/prettier-plugin-import-order'),
],
}

0 comments on commit d844d0b

Please sign in to comment.