Skip to content

Commit

Permalink
refactor: tsconfig, lint-staged (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp authored Dec 21, 2022
1 parent d221956 commit 740cad8
Show file tree
Hide file tree
Showing 46 changed files with 6,893 additions and 8,472 deletions.
3 changes: 1 addition & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
indent_size = 2
trim_trailing_whitespace = true

[*.md]
indent_size = 2
trim_trailing_whitespace = false

[*.{yml,yaml}]
Expand Down
10 changes: 0 additions & 10 deletions .eslintrc.js

This file was deleted.

42 changes: 21 additions & 21 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
---
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
commit-message:
include: 'scope'
prefix: 'github-actions'
labels:
- 'deps'
open-pull-requests-limit: 10
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
commit-message:
include: 'scope'
prefix: 'github-actions'
labels:
- 'deps'
open-pull-requests-limit: 10

- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
commit-message:
include: 'scope'
prefix: 'npm'
labels:
- 'deps'
open-pull-requests-limit: 10
versioning-strategy: 'increase'
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
commit-message:
include: 'scope'
prefix: 'npm'
labels:
- 'deps'
open-pull-requests-limit: 10
versioning-strategy: 'increase'
14 changes: 7 additions & 7 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# Documentation https://github.com/marketplace/actions/labeler

'type: documentation':
- assets/**/*
- .github/*
- ./*.md
- assets/**/*
- .github/*
- ./*.md

'type: maintenance':
- .dependabot/*
- .github/**/*
- app/tests/**/*
- tests/**/*
- .dependabot/*
- .github/**/*
- app/tests/**/*
- tests/**/*
2 changes: 1 addition & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "./node_modules/@wayofdev/markdownlint-config/index.json"
"extends": "./node_modules/@wayofdev/markdownlint-config/index.json"
}
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/
.next/
pnpm-lock.yaml
.changeset/*.md
8 changes: 4 additions & 4 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// 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: 4,
useTabs: false,
...require('@wayofdev/prettier-config'),
semi: false,
tabWidth: 2,
useTabs: false,
}
2 changes: 1 addition & 1 deletion .secretlintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
...require("@wayofdev/secretlint-config"),
...require("@wayofdev/secretlint-config"),
};
18 changes: 9 additions & 9 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// https://github.com/wayofdev/npm-shareable-configs/blob/master/packages/stylelint-config/README.md
module.exports = {
// ignore linting in dist bundle output folder
ignoreFiles: ['dist/**'],
extends: '@wayofdev/stylelint-config/scss',
overrides: [
{
files: ['**/*.css'],
extends: '@wayofdev/stylelint-config',
},
],
// ignore linting in dist bundle output folder
ignoreFiles: ['dist/**'],
extends: '@wayofdev/stylelint-config/scss',
overrides: [
{
files: ['**/*.css'],
extends: '@wayofdev/stylelint-config',
},
],
}
6 changes: 3 additions & 3 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
extends: default

ignore: |
pnpm-lock.yaml
pnpm-workspace.yaml
node_modules/
pnpm-lock.yaml
pnpm-workspace.yaml
node_modules/

# Overwrite above default rules
rules:
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ endif
.PHONY: env

install:
$(NPM_RUNNER) install -r
$(NPM_RUNNER) i
.PHONY: install

update:
Expand All @@ -107,8 +107,8 @@ build:
$(NPM_RUNNER) run build
.PHONY: build

purge:
rm -rf .pnpm-store node_modules pnpm-lock.yaml
purge: down
rm -rf .pnpm-store node_modules **/node_modules pnpm-lock.yaml
.PHONY: purge


Expand Down
19 changes: 17 additions & 2 deletions apps/docs/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
module.exports = {
root: true,
extends: ["custom"],
};
extends: ['custom'],
plugins: ['import'],
parserOptions: {
project: ['tsconfig.json'],
tsconfigRootDir: __dirname,
},
overrides: [
{
files: ['**/*.js'],
extends: ['@wayofdev/eslint-config/'],
},
],
rules: {
'import/extensions': 'off',
},
ignorePatterns: ['dist/**', '.next/**'],
}
18 changes: 12 additions & 6 deletions apps/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,27 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the

You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed
on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited
in `pages/api/hello.js`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated
as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial.
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions
are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js.
The easiest way to deploy your Next.js app is to use
the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme)
from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
56 changes: 30 additions & 26 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
{
"name": "docs",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "next dev --port 3001",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "13.0.7",
"react": "18.2.0",
"react-dom": "18.2.0",
"ui": "workspace:0.0.0"
},
"devDependencies": {
"@babel/core": "^7.20.5",
"@types/node": "^18.11.17",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@wayofdev/browserslist-config": "^1.0.0",
"eslint": "^7.32.0",
"eslint-config-custom": "workspace:0.0.0",
"tsconfig": "workspace:0.0.0",
"typescript": "^4.9.4"
}
"name": "docs",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "next dev --port 3001",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "13.0.7",
"react": "18.2.0",
"react-dom": "18.2.0",
"ui": "workspace:*"
},
"devDependencies": {
"@types/jest": "^29.2.4",
"jest": "^29.3.1",
"jest-config": "workspace:*",
"@babel/core": "^7.20.5",
"@types/node": "^18.11.17",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@wayofdev/browserslist-config": "^1.1.0",
"eslint": "^8.30.0",
"eslint-config-custom": "workspace:*",
"tsconfig-config": "workspace:*",
"typescript": "^4.9.4",
"npm-run-all": "^4.1.5"
}
}
14 changes: 7 additions & 7 deletions apps/docs/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Button } from 'ui'

export default function Docs() {
return (
<div>
<h1>Docs</h1>
<Button />
</div>
)
export default function Documentation() {
return (
<div>
<h1>Documentation</h1>
<Button />
</div>
)
}
14 changes: 12 additions & 2 deletions apps/docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"extends": "tsconfig/nextjs.json",
"extends": "tsconfig-config/next.json",
"exclude": ["node_modules", "dist", "coverage"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"compilerOptions": {
"outDir": "dist",
"baseUrl": "./",
// "paths": {
// "@/*": [
// "src/*"
// ]
// }
"moduleResolution": "node"
}
}
6 changes: 0 additions & 6 deletions apps/web/.eslintrc

This file was deleted.

19 changes: 19 additions & 0 deletions apps/web/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
root: true,
extends: ['custom'],
plugins: ['import'],
parserOptions: {
project: ['tsconfig.json'],
tsconfigRootDir: __dirname,
},
overrides: [
{
files: ['**/*.js'],
extends: ['@wayofdev/eslint-config/'],
},
],
rules: {
'import/extensions': 'off',
},
ignorePatterns: ['dist/**', '.next/**'],
}
18 changes: 12 additions & 6 deletions apps/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,27 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the

You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed
on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited
in `pages/api/hello.js`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated
as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial.
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions
are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js.
The easiest way to deploy your Next.js app is to use
the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme)
from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
8 changes: 4 additions & 4 deletions apps/web/next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
reactStrictMode: true,
experimental: {
transpilePackages: ['ui'],
},
reactStrictMode: true,
experimental: {
transpilePackages: ['ui'],
},
}
Loading

0 comments on commit 740cad8

Please sign in to comment.