Skip to content

Commit 72c4107

Browse files
committed
feat: Add ESLint configuration and enhance package scripts
- Introduced .eslintrc.json for linting JavaScript and TypeScript code with recommended rules. - Updated package.json to include new linting and testing scripts for improved development workflow. - Added pre-publish script to ensure build and CLI tests are run before publishing.
1 parent 20e4e8c commit 72c4107

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

.eslintrc.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"env": {
3+
"es2022": true,
4+
"node": true
5+
},
6+
"extends": [
7+
"eslint:recommended"
8+
],
9+
"parserOptions": {
10+
"ecmaVersion": "latest",
11+
"sourceType": "module"
12+
},
13+
"rules": {
14+
"no-unused-vars": "warn",
15+
"prefer-const": "error",
16+
"no-console": "off"
17+
},
18+
"ignorePatterns": [
19+
"lib/**/*",
20+
"node_modules/**/*",
21+
"templates/**/*"
22+
]
23+
}

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
"dev": "npx tsx src/cli/index.ts",
1414
"test": "jest",
1515
"lint": "eslint src/**/*.ts",
16-
"prepublishOnly": "npm run build"
16+
"lint:fix": "eslint src/**/*.ts --fix",
17+
"test:cli": "node bin/index.js --help",
18+
"test:create": "mkdir -p test-temp && cd test-temp && node ../bin/index.js test-project --skip-install && cd .. && rm -rf test-temp",
19+
"pre-publish": "npm run build && npm run test:cli",
20+
"prepublishOnly": "npm run pre-publish"
1721
},
1822
"dependencies": {
1923
"chalk": "^5.3.0",

0 commit comments

Comments
 (0)