Skip to content

Commit

Permalink
feat: codeclimate, vscode, refactor ignore files
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed Jan 1, 2023
1 parent b5d63fc commit 70039d4
Show file tree
Hide file tree
Showing 20 changed files with 459 additions and 150 deletions.
67 changes: 67 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# @link https://docs.codeclimate.com/docs/default-analysis-configuration#sample-codeclimateyml

version: '2'

checks:
argument-count:
enabled: true
config:
threshold: 4
complex-logic:
enabled: true
config:
threshold: 4
file-lines:
enabled: true
config:
threshold: 300
method-complexity:
enabled: true
config:
threshold: 5
method-count:
enabled: true
config:
threshold: 20
method-lines:
enabled: true
config:
threshold: 300
nested-control-flow:
enabled: true
config:
threshold: 4
return-statements:
enabled: true
config:
threshold: 4
similar-code:
enabled: false
config:
threshold: 5
identical-code:
enabled: false
config:
threshold: 5

# plugins:
# eslint:
# enabled: true
# channel: "eslint-7"

exclude_patterns:
- 'docs/'
- '**/node_modules/'
- '**/config/'
- '**/*.config.js'
- '**/dist/'
- '**/scripts/'
- '**/__tests__/'
- '**/*.test.js'
- '**/*.test.jsx'
- '**/*.test.ts'
- '**/*.test.tsx'
- '**/*.d.ts'
- '**/*.seed.ts'
- '**/seed.ts'
- '**/.mesh/'
96 changes: 64 additions & 32 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,46 +1,78 @@
# All node_modules directories
node_modules/
# All secrets
**/.env
**/.env.local
**/.env.*.local
# dependencies
node_modules
**/node_modules/
.pnp.*
.pnp
.pnpm-store

# testing
coverage/*
cypress/screenshots/
cypress/videos/
.out/

# next.js and build directories
# ...

# misc
.DS_Store
*.pem
Thumbs.db

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
**/.debug
logs/
*.log
.turbo/
**/.turbo/

# local env files
# By default all git files
.env
**/.env
.env.local
.env.*.local

# deployment platforms
.vercel

# cache
.eslintcache
**/.eslintcache
.stylelintcache
.cache/*
**/tsconfig.tsbuildinfo

# editors
.idea/
.vscode/

# temp files
tmp/
*.tmp

# by default all git files
.git/
.gitignore
.gitattributes
.github/

# Tools caches
.cache/*
tsconfig.tsbuildinfo
.eslintcache
# docker related
.dockerignore
Dockerfile
docker-compose.*.yml
docker-compose.yml
docker/

# Used when building with nextjs (next-eslint)
# allow
# used when building with nextjs (next-eslint)
!.eslintrc.base.json
!.prettierignore
!.prettierrc.js
!.eslintignore

# npm
!.npmrc

# Docker related
.dockerignore
Dockerfile
docker-compose.*.yml
docker-compose.yml
docker/

# Log files
logs/
*.log
.turbo/
**/.turbo/

# Temp files
tmp/
*.tmp

# IDE related
.idea/
41 changes: 26 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# editors
.idea
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files
# and https://github.com/github/gitignore for examples

# dependencies
node_modules
.pnp.*
.pnp
.pnp.js
.pnpm-store

# testing
coverage/

# cypress
cypress/screenshots/
cypress/videos/
.out/

# next.js
# next.js and build directories
.next/
out/
build/
Expand All @@ -38,18 +35,19 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
**/.debug
logs/
*.log
.turbo/
**/.turbo/

# local env files
.env
**/.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# turbo
.turbo
.env.*.local

# vercel
# deployment platforms
.vercel

# cache
Expand All @@ -62,3 +60,16 @@ yarn-error.log*
# override files
docker-compose.override.yml

# editors
.idea

.vscode/
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# temp files
tmp/
*.tmp
6 changes: 6 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
strict-peer-dependencies=false
engine-strict=true

### https://gist.github.com/belgattitude/838b2eba30c324f1f0033a797bab2e31#recommended-npmrc
# https://pnpm.io/next/npmrc#strict-peer-dependencies
strict-peer-dependencies=true
# https://pnpm.io/npmrc#auto-install-peers
auto-install-peers=false
34 changes: 26 additions & 8 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
// More, about extending this config:
// https://github.com/wayofdev/npm-shareable-configs/blob/master/packages/prettier-config/README.md
module.exports = {
...require('@wayofdev/prettier-config'),
semi: false,
tabWidth: 2,
useTabs: false,
}
// @ts-check

const { getPrettierConfig } = require('@wayofdev/eslint-config-custom/helpers');

const { overrides = [], ...prettierConfig } = getPrettierConfig();

/**
* @type {import('prettier').Config}
*/
const config = {
...prettierConfig,
overrides: [
...overrides,
...[
{
files: '*.md',
options: {
singleQuote: false,
quoteProps: 'preserve',
},
},
],
],
};

module.exports = config;
6 changes: 6 additions & 0 deletions .vercelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.github/
.changeset/
.husky/
docker/
README.md
CHANGELOG.md
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<a href="https://github.com/wayofdev/next-starter-tpl/tags"><img src="https://img.shields.io/github/v/tag/wayofdev/next-starter-tpl?sort=semver&style=flat-square" alt="Latest Version"></a>
<a href="LICENSE.md"><img src="https://img.shields.io/github/license/wayofdev/next-starter-tpl.svg?style=flat-square&color=blue" alt="Software License"/></a>
<a href="#"><img alt="Commits since latest release" src="https://img.shields.io/github/commits-since/wayofdev/next-starter-tpl/latest?style=flat-square"></a>
<a href="#"><img alt="Code Climate maintainability" src="https://img.shields.io/codeclimate/maintainability/wayofdev/next-starter-tpl?style=flat-square"></a>
<a href="#"><img alt="Code Climate issues" src="https://img.shields.io/codeclimate/issues/wayofdev/next-starter-tpl?style=flat-square"></a>
<a href="#"><img alt="Code Climate technical debt" src="https://img.shields.io/codeclimate/tech-debt/wayofdev/next-starter-tpl?style=flat-square"></a>
<a href="#"><img alt="Code Climate coverage" src="https://img.shields.io/codeclimate/coverage/wayofdev/next-starter-tpl?style=flat-square"></a>
</div>

<br>
Expand Down Expand Up @@ -181,7 +185,11 @@ make test

<br>

## 🧱 Useful Resources
## 🧱 Credits and Useful Resources

Based on [nextjs-monorepo-example](https://github.com/belgattitude/nextjs-monorepo-example) template from [belgattitude](https://github.com/belgattitude).

- Check his benchmark on package managers — [belgattitude/compare-package-managers](https://github.com/belgattitude/compare-package-managers)

Learn more about the power of **Turborepo**:

Expand All @@ -202,7 +210,6 @@ Other monorepo templates:
Other projects:

- [ixartz/next-js-boilerplate](https://github.com/ixartz/Next-js-Boilerplate)
- [laravel/breeze-next](https://github.com/laravel/breeze-next)

<br>

Expand Down
46 changes: 37 additions & 9 deletions apps/docs/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@
/**
* Specific eslint rules for this app/package, extends the base rules
* @see https://github.com/belgattitude/nextjs-monorepo-example/blob/main/docs/about-linters.md
* @see https://github.com/wayofdev/next-starter-tpl/blob/master/docs/about-linters.md
*/

// Workaround for https://github.com/eslint/eslint/issues/3458 (re-export of @rushstack/eslint-patch)
require('@wayofdev/eslint-config-custom/patch/modern-module-resolution')

const { getDefaultIgnorePatterns } = require('@wayofdev/eslint-config-custom/helpers')

module.exports = {
root: true,
extends: ['custom'],
plugins: ['import'],
parserOptions: {
project: ['tsconfig.json'],
tsconfigRootDir: __dirname,
project: 'tsconfig.json',
},
ignorePatterns: [...getDefaultIgnorePatterns(), '.next', '.out'],
extends: [
'@wayofdev/eslint-config-custom/typescript',
'@wayofdev/eslint-config-custom/sonar',
'@wayofdev/eslint-config-custom/regexp',
'@wayofdev/eslint-config-custom/jest',
'@wayofdev/eslint-config-custom/react',
'@wayofdev/eslint-config-custom/tailwind',
'@wayofdev/eslint-config-custom/rtl',
// Add specific rules for nextjs
'plugin:@next/next/core-web-vitals',
// Apply prettier and disable incompatible rules
'@wayofdev/eslint-config-custom/prettier',
],
rules: {
// https://github.com/vercel/next.js/discussions/16832
'@next/next/no-img-element': 'off',
// For the sake of example
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md
'jsx-a11y/anchor-is-valid': 'off',
},
overrides: [
{
files: ['**/*.js'],
extends: ['@wayofdev/eslint-config/'],
files: ['src/pages/\\_*.{ts,tsx}'],
rules: {
'react/display-name': 'off',
},
},
],
rules: {
'import/extensions': 'off',
},
ignorePatterns: ['dist/**', '.next/**'],
}
Loading

0 comments on commit 70039d4

Please sign in to comment.