Skip to content

Commit

Permalink
Merge pull request #4 from r34son/prettier
Browse files Browse the repository at this point in the history
Linting
  • Loading branch information
r34son authored Oct 15, 2023
2 parents b8ea7b5 + 5502f4b commit bb4238a
Show file tree
Hide file tree
Showing 18 changed files with 4,567 additions and 1,362 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,17 @@ jobs:
--to ${{ github.event.pull_request.head.sha }} \
--verbose
- name: Format
run: pnpm run format:check

- name: Lint
run: pnpm run lint:check

- name: Typecheck
run: pnpm run types:check

- name: Run the tests and generate coverage report
run: pnpm test -- --coverage
run: pnpm test -- --coverage --coverageReporters=text --coverageReporters=cobertura

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ yarn-error.log*
# vercel
.vercel

# caches
.eslintcache
.stylelintcache

# typescript
*.tsbuildinfo
next-env.d.ts
Expand Down
4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pnpm-lock.yaml
package.json
1 change: 1 addition & 0 deletions __tests__/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ describe('Home', () => {
name: /By Vercel Logo/i,
});

// @ts-ignore
expect(heading).toBeInTheDocument();
});
});
1 change: 0 additions & 1 deletion commitlint.config.js

This file was deleted.

17 changes: 14 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
const withPlugins = require('next-compose-plugins');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const { withSentryConfig } = require('@sentry/nextjs');

/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
};

module.exports = withSentryConfig(
nextConfig,
withPlugins([[withBundleAnalyzer]], nextConfig),
{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options
Expand Down Expand Up @@ -32,5 +43,5 @@ module.exports = withSentryConfig(

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
}
},
);
77 changes: 70 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,38 @@
"version": "0.1.0",
"packageManager": "[email protected]",
"engines": {
"node": "18"
"node": "18",
"pnpm": "7.x"
},
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"build": "ANALYZE=true next build",
"start": "next start",
"lint": "next lint",
"format:check": "prettier . --cache --check",
"format:fix": "pnpm run format:check --write",
"lint:check": "run-p --continue-on-error \"lint:*:check\"",
"lint:fix": "run-p --continue-on-error \"lint:*:fix\"",
"lint:code:check": "eslint . --cache --ignore-path .gitignore",
"lint:code:fix": "pnpm run lint:code:check --fix",
"lint:styles:check": "stylelint \"**/*.css\" --cache --ignore-path .gitignore",
"lint:styles:fix": "pnpm run lint:styles:check --fix",
"preinstall": "npx only-allow pnpm",
"setup": "is-ci || simple-git-hooks",
"test": "jest",
"prepare": "is-ci || husky install",
"commitlint": "commitlint --edit"
"test:e2e": "exit 0",
"types:check": "tsc --noEmit",
"validate": "run-p format:check lint:check types:check test test:e2e"
},
"dependencies": {
"@next/bundle-analyzer": "^13.5.4",
"@sentry/nextjs": "^7.74.0",
"@vercel/analytics": "^1.1.1",
"next": "13.5.4",
"next-compose-plugins": "^2.2.1",
"react": "^18",
"react-dom": "^18"
"react-dom": "^18",
"stylelint-config-standard": "^34.0.0"
},
"devDependencies": {
"@commitlint/cli": "^17.8.0",
Expand All @@ -33,10 +47,59 @@
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "13.5.4",
"husky": "^8.0.0",
"eslint-config-prettier": "^9.0.0",
"is-ci": "^3.0.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^15.0.0",
"npm-run-all2": "^6.1.1",
"prettier": "3.0.3",
"simple-git-hooks": "^2.9.0",
"stylelint": "^15.10.3",
"typescript": "^5"
},
"browserslist": {
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
],
"production": [
">=0.75%",
"not dead",
"not op_mini all"
]
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"eslintConfig": {
"extends": [
"next/core-web-vitals",
"prettier"
]
},
"prettier": {
"singleQuote": true
},
"stylelint": {
"extends": "stylelint-config-standard"
},
"lint-staged": {
"*.@(js|ts|tsx)": [
"eslint --cache --fix",
"prettier --cache --write"
],
"*.@(css)": [
"stylelint --cache --fix",
"prettier --cache --write"
],
"*.!(css|js|ts|tsx)": "prettier --cache --ignore-unknown --write"
},
"simple-git-hooks": {
"commit-msg": "pnpm exec commitlint --edit",
"pre-commit": "pnpm exec lint-staged"
}
}
Loading

0 comments on commit bb4238a

Please sign in to comment.