Skip to content

Commit

Permalink
chore: update dev dependencies + commitlint settings (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed authored Oct 31, 2024
2 parents 2d72b22 + 1440f75 commit 4230eed
Show file tree
Hide file tree
Showing 27 changed files with 2,109 additions and 1,797 deletions.
29 changes: 0 additions & 29 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ node_modules/*
.DS_Store
.idea/
.vscode/
.husky/
.husky/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ Run these steps once to setup commitlint + husky.
# Install dev dependencies (commitlint & husky)
npm install
# Install husky git hook
npx husky install
npx husky
# Add commitlint as a hook to husky
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
echo 'npx --no -- commitlint --edit ${1}' > .husky/commit-msg
```

### Usage
Expand Down
26 changes: 25 additions & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
export default {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
// default set:
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test',
// bento added:
'lint',
],
],
},
};
46 changes: 46 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import globals from 'globals';
import js from '@eslint/js';

// Parser
import tsParser from '@typescript-eslint/parser';

// Plugins
import tsEsLint from 'typescript-eslint';
import react from 'eslint-plugin-react';
import reactHooksEsLint from 'eslint-plugin-react-hooks';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import prettier from 'eslint-plugin-prettier';

export default [
js.configs.recommended,
...tsEsLint.configs.recommended,
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
eslintPluginPrettierRecommended,
{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: { ...globals.browser, ...globals.es2021 },
parser: tsParser,
},
files: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.js', 'src/**/*.jsx'],
plugins: {
react,
'react-hooks': reactHooksEsLint,
prettier,
},

settings: {
react: {
version: 'detect',
},
},
rules: {
'prettier/prettier': 'error',
'react/prop-types': 'off',
semi: [2, 'always'],
...reactHooksEsLint.configs.recommended.rules,
},
},
];
Loading

0 comments on commit 4230eed

Please sign in to comment.