Skip to content

Commit

Permalink
feat(nodecli): add eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbutt committed Feb 21, 2024
1 parent 1401082 commit 60d4d9b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@
{
"$ref": "#/files/paths/tests"
},
{
"$ref": "#/files/paths/eslintrc"
},
{
"$ref": "#/files/paths/vitestconfigjs"
}
Expand Down
12 changes: 12 additions & 0 deletions templates/nodecli/eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"root": true,
"env": {
"node": true,
"browser": true
},
"extends": ["eslint:recommended", "prettier"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
}
}
2 changes: 1 addition & 1 deletion templates/nodecli/lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"*?(test|spec).{js,jsx,ts,tsx}": ["prettier --write"],
"*?(test|spec).{js,jsx,ts,tsx}": ["eslint --fix", "prettier --write"],
"*.{css,scss,md,html,json,yml,yaml}": ["prettier --write"]
}
3 changes: 3 additions & 0 deletions templates/nodecli/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"scripts": {
"commit": "git-cz",
"lint": "eslint . --fix",
"pretty:fix": "prettier --write .",
"start": "cross-env NODE_ENV=production node dist/app.js",
"dev": "nodemon src/app.js",
Expand All @@ -38,6 +39,8 @@
<%- node.getDevDependency("cross-env") %>,
<%- node.getDevDependency("cz-conventional-changelog") %>,
<%- node.getDevDependency("doctoc") %>,
<%- node.getDevDependency("eslint") %>,
<%- node.getDevDependency("eslint-config-prettier") %>,
<%- node.getDevDependency("husky") %>,
<%- node.getDevDependency("lint-staged") %>,
<%- node.getDevDependency("nodemon") %>,
Expand Down

0 comments on commit 60d4d9b

Please sign in to comment.