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

style(code): setup commit convention #42

Merged
merged 6 commits into from
Apr 30, 2024
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: yarn install --frozen-lockfile
- run: yarn stylelint:actions
- run: yarn build
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn commitlint --edit $1
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
yarn.lock
.prettierignore
.gitignore
.husky
15 changes: 15 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"plugins": ["stylelint-plugin-defensive-css"],
"extends": [
"stylelint-config-standard-scss",
"stylelint-config-tailwindcss/scss"
],
"rules": {
"plugin/use-defensive-css": [
true,
{
"severity": "warning"
}
]
}
}
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
# Lynx Scanner

## Project setup

### NodeJS

```shell
yarn
```

### Git

After a git pull, don't forget to do a yarn again
23 changes: 23 additions & 0 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export default {
extends: ['@commitlint/config-conventional'],
formatter: '@commitlint/format',
rules: {
'type-enum': [
2,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test',
],
],
},
};
20 changes: 18 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"typedoc": "typedoc",
"prepare": "husky",
"eslint": "eslint --fix .",
"prettier": "prettier --write ."
"prettier": "prettier --write .",
"stylelint:actions": "stylelint --fix \"src/**/*.{css,scss}\""
},
"dependencies": {
"autoprefixer": "^10.4.19",
Expand All @@ -22,6 +23,9 @@
"tailwindcss": "^3.4.3"
},
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@commitlint/format": "^19.3.0",
"@eslint/eslintrc": "^3.0.2",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
Expand All @@ -39,6 +43,11 @@
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"sass": "^1.75.0",
"stylelint": "^16.4.0",
"stylelint-actions-formatters": "^16.3.1",
"stylelint-config-standard-scss": "^13.1.0",
"stylelint-config-tailwindcss": "^0.0.7",
"stylelint-plugin-defensive-css": "^1.0.3",
"typedoc": "^0.25.13",
"typedoc-plugin-markdown": "^3.17.1",
"typedoc-plugin-mdn-links": "^3.1.22",
Expand All @@ -47,9 +56,16 @@
"vite-plugin-eslint": "^1.8.1"
},
"lint-staged": {
"*.{ts,tsx,cjs,svg,json}": [
"*.{css,scss}": [
"stylelint --fix",
"prettier --write"
],
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write"
],
"!(*.{css,scss,js,jsx,ts,tsx})": [
"prettier --write"
]
}
}
2 changes: 1 addition & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export default {
tailwindcss: {},
autoprefixer: {},
},
}
};
3 changes: 0 additions & 3 deletions src/app.scss

This file was deleted.

1 change: 0 additions & 1 deletion src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { JSX } from 'react';
import './app.scss';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import UserLogin from './components/UserLogin';
import Homepage from './components/home-page';
Expand Down
3 changes: 3 additions & 0 deletions src/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
5 changes: 2 additions & 3 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ["./src/**/*.{tsx,scss}"],
content: ['./src/**/*.{tsx,scss}'],
theme: {
extend: {},
},
plugins: [],
}

};
Loading
Loading