Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/set up eslint and prettier #112

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.next/
node_modules/
coverage/
__snapshots__/
package-lock.json
42 changes: 42 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"extends": [
"airbnb",
"plugin:@typescript-eslint/recommended",
"next/core-web-vitals",
"prettier"
],
"plugins": ["import", "unused-imports"],
"rules": {
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "warn",
"import/extensions": "off",
"import/order": [
"error",
{
"groups": [
"builtin",
"external",
"internal",
["parent", "sibling"],
"object",
"type",
"index"
],
"newlines-between": "always",
"pathGroupsExcludedImportTypes": ["builtin"],
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"react/jsx-filename-extension": [
"error",
{
"extensions": [".jsx", ".tsx"]
}
] // also want to use with ".tsx"
},
"overrides": [],
"ignorePatterns": ["node_modules"]
}
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ignore artifacts:
build
coverage

# Ignore all HTML files:
*.html
*.md
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true
}
26 changes: 20 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
"dev": "NODE_OPTIONS='--inspect' next",
"build": "next build",
"start": "next start",
"typecheck": "tsc",
"postbuild": "next-sitemap"
"lint": "next lint --fix --dir src",
"format": "prettier --write .",
"postbuild": "next-sitemap",
"preinstall": "npx only-allow yarn"
},
"dependencies": {
"classnames": "2.3.1",
Expand All @@ -20,13 +22,25 @@
},
"devDependencies": {
"@types/gtag.js": "^0.0.10",
"@types/jest": "^27.5.1",
"@types/node": "^17.0.40",
"@types/jest": "^28.1.3",
"@types/node": "^18.0.1",
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.13",
"@typescript-eslint/eslint-plugin": "^5.30.0",
"@typescript-eslint/parser": "^5.0.0",
"autoprefixer": "^10.4.7",
"next-sitemap": "^2.5.20",
"eslint": "8.18.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-next": "12.1.6",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-unused-imports": "^2.0.0",
"next-sitemap": "^2.5.28",
"postcss": "^8.4.14",
"tailwindcss": "^3.0.24"
"prettier": "2.7.1",
"tailwindcss": "^3.1.4"
}
}
6 changes: 3 additions & 3 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module.exports = {
theme: {
extend: {
colors: {
'link': '#1d9bf0',
'primary': '#ffffff',
'secondary': '#B3B3B3',
link: '#1d9bf0',
primary: '#ffffff',
secondary: '#B3B3B3',
},
spacing: {
28: '7rem',
Expand Down
18 changes: 4 additions & 14 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2022",
"module": "esnext",
"jsx": "preserve",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"noEmit": true,
"moduleResolution": "node",
Expand All @@ -23,12 +19,6 @@
"@/*": ["./src/*"]
}
},
"exclude": [
"node_modules"
],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
]
"exclude": ["node_modules"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
}
Loading