Skip to content

Commit

Permalink
add prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
emiljohansson committed Feb 18, 2023
1 parent 608bc68 commit 323371e
Show file tree
Hide file tree
Showing 9 changed files with 178 additions and 117 deletions.
16 changes: 16 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.DS_Store
node_modules
build
public
dist
.next
.svelte-kit
.env
.env.*
!.env.example
.git

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
16 changes: 16 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.DS_Store
node_modules
build
public
dist
.next
.svelte-kit
.env
.env.*
!.env.example
.git

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": false,
"useTabs": true,
"singleQuote": false,
"trailingComma": "all",
"printWidth": 100,
"plugins": [],
"pluginSearchDirs": ["."],
"overrides": []
}
6 changes: 2 additions & 4 deletions apps/next/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { FunctionComponent, ReactNode } from 'react'
import type { FunctionComponent, ReactNode } from "react"

const Layout: FunctionComponent<{ children: ReactNode }> = ({ children }) => {
return (
<main>{children}</main>
)
return <main>{children}</main>
}

export default Layout
8 changes: 8 additions & 0 deletions apps/next/x.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
...require("config/eslint-preset.js"),
parserOptions: {
tsconfigRootDir: __dirname,
project: "./tsconfig.json",
},
ignorePatterns: [".eslintrc.js"],
}
95 changes: 48 additions & 47 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,50 @@
{
"name": "emiljohansson.dev",
"description": "Playground for Emil Johansson",
"version": "1.2.1",
"author": "[email protected]",
"keywords": [
"emil",
"johansson"
],
"license": "MIT",
"scripts": {
"build": "turbo run build",
"export": "turbo run export",
"dev": "turbo run dev --parallel",
"start": "turbo run start",
"test": "turbo run test",
"test:ci": "start-server-and-test start http://localhost:3000 \"cypress run --headless --browser chrome\"",
"cy:run": "cypress run --headless --browser chrome",
"cy:open": "cypress open",
"lint": "turbo run lint"
},
"workspaces": [
"packages/*",
"apps/*"
],
"dependencies": {
"@tailwindcss/typography": "0.5.4",
"autoprefixer": "10.4.2",
"postcss": "8.4.14",
"tailwindcss": "3.1.7"
},
"devDependencies": {
"@cypress-audit/lighthouse": "1.3.1",
"@types/jest": "27.4.0",
"@types/node": "18.0.1",
"@types/react": "18.0.15",
"@types/react-dom": "18.0.6",
"axe-core": "4.4.3",
"cypress": "12.1.0",
"cypress-axe": "1.2.0",
"husky": "8.0.1",
"jest": "27.5.1",
"start-server-and-test": "1.14.0",
"ts-jest": "27.1.3",
"turbo": "1.4.5",
"typescript": "4.8.2"
},
"packageManager": "[email protected]"
"name": "emiljohansson.dev",
"description": "Playground for Emil Johansson",
"version": "1.2.1",
"author": "[email protected]",
"keywords": [
"emil",
"johansson"
],
"license": "MIT",
"scripts": {
"build": "turbo run build",
"export": "turbo run export",
"dev": "turbo run dev --parallel",
"start": "turbo run start",
"test": "turbo run test",
"test:ci": "start-server-and-test start http://localhost:3000 \"cypress run --headless --browser chrome\"",
"cy:run": "cypress run --headless --browser chrome",
"cy:open": "cypress open",
"lint": "turbo run lint"
},
"workspaces": [
"packages/*",
"apps/*"
],
"dependencies": {
"@tailwindcss/typography": "0.5.4",
"autoprefixer": "10.4.2",
"postcss": "8.4.14",
"tailwindcss": "3.1.7"
},
"devDependencies": {
"@cypress-audit/lighthouse": "1.3.1",
"@types/jest": "27.4.0",
"@types/node": "18.0.1",
"@types/react": "18.0.15",
"@types/react-dom": "18.0.6",
"axe-core": "4.4.3",
"cypress": "12.1.0",
"cypress-axe": "1.2.0",
"husky": "8.0.1",
"jest": "27.5.1",
"prettier": "2.8.4",
"start-server-and-test": "1.14.0",
"ts-jest": "27.1.3",
"turbo": "1.4.5",
"typescript": "4.8.2"
},
"packageManager": "[email protected]"
}
68 changes: 30 additions & 38 deletions packages/config/eslint-preset.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,32 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
settings: {
next: {
rootDir: ['apps/*/', 'packages/*/'],
},
},
extends: [
'standard',
'plugin:@typescript-eslint/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [
'react',
'@typescript-eslint',
],
rules: {
'react/react-in-jsx-scope': 'off',
'import/no-anonymous-default-export': 'off',
'comma-dangle': ['error', 'always-multiline'],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'@typescript-eslint/no-explicit-any': 'error',
'func-call-spacing': 'off',
'@typescript-eslint/func-call-spacing': 'error',
indent: 'off',
'@typescript-eslint/indent': ['error', 2],
'jsx-quotes': ['error', 'prefer-double'],
},
env: {
browser: true,
es2021: true,
},
settings: {
next: {
rootDir: ["apps/*/", "packages/*/"],
},
},
extends: ["standard", "plugin:@typescript-eslint/recommended", "prettier"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["react", "@typescript-eslint"],
// rules: {
// "react/react-in-jsx-scope": "off",
// "import/no-anonymous-default-export": "off",
// "comma-dangle": ["error", "always-multiline"],
// "no-unused-vars": "off",
// "@typescript-eslint/no-unused-vars": ["error"],
// "@typescript-eslint/no-explicit-any": "error",
// "func-call-spacing": "off",
// "@typescript-eslint/func-call-spacing": "error",
// "jsx-quotes": ["error", "prefer-double"],
// },
}
45 changes: 23 additions & 22 deletions packages/config/package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
{
"name": "config",
"version": "1.0.0",
"main": "eslint-preset.js",
"license": "MIT",
"dependencies": {
"next": "13.1.1",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "5.10.0",
"@typescript-eslint/parser": "5.10.0",
"eslint": "8.23.0",
"eslint-config-next": "13.0.0",
"eslint-config-standard": "17.0.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-n": "^15.2.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "6.0.0",
"eslint-plugin-react": "7.28.0",
"typescript": "4.8.2"
}
"name": "config",
"version": "1.0.0",
"main": "eslint-preset.js",
"license": "MIT",
"dependencies": {
"next": "13.1.1",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "5.10.0",
"@typescript-eslint/parser": "5.10.0",
"eslint": "8.23.0",
"eslint-config-next": "13.0.0",
"eslint-config-standard": "17.0.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-n": "^15.2.0",
"eslint-plugin-node": "11.1.0",
"eslint-config-prettier": "latest",
"eslint-plugin-promise": "6.0.0",
"eslint-plugin-react": "7.28.0",
"typescript": "4.8.2"
}
}
31 changes: 25 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 323371e

Please sign in to comment.