Skip to content

Commit ad1ddcc

Browse files
committed
chore(package): Install linter packages
1 parent ea02744 commit ad1ddcc

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

eslint.config.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// eslint.config.js
2+
import parser from "@typescript-eslint/parser";
3+
import eslintPlugin from "@typescript-eslint/eslint-plugin";
4+
import stylistic from "@stylistic/eslint-plugin"
5+
6+
export default [
7+
{
8+
files: ["**/*.ts", "**/*.tsx"],
9+
languageOptions: {
10+
parser,
11+
parserOptions: {
12+
ecmaVersion: "latest",
13+
sourceType: "module",
14+
project: "./tsconfig.json",
15+
},
16+
},
17+
plugins: {
18+
"@typescript-eslint": eslintPlugin,
19+
"@stylistic": stylistic,
20+
},
21+
rules: {
22+
...eslintPlugin.configs.recommended.rules,
23+
"@stylistic/comma-spacing": ["error", { "before": false, "after": true }],
24+
"@stylistic/indent": ["error", 4],
25+
"@stylistic/key-spacing": ["error"],
26+
"@stylistic/space-before-blocks": "error",
27+
"@stylistic/quotes": ["error", "double"],
28+
"@stylistic/no-multi-spaces": "error",
29+
"@stylistic/no-trailing-spaces": "error",
30+
"@stylistic/semi": ["error", "never"],
31+
"@stylistic/space-before-function-paren": ["error", {
32+
"asyncArrow": "ignore"
33+
}],
34+
},
35+
},
36+
];

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
"name": "commitlint-plugin-prevenger",
33
"version": "1.0.2",
44
"main": "dist/index.js",
5+
"type": "module",
56
"scripts": {
7+
"lint": "npx eslint src/ --ext .ts",
8+
"build": "tsc",
69
"test": "jest --coverage",
7-
"build": "tsc"
10+
"clean": "rm -rf node_modules package-lock.json dist && npm install"
811
},
912
"files": [
1013
"dist/",
@@ -29,18 +32,23 @@
2932
"description": "A Commitlint plugin that is containing some toolkits for checking the commit message",
3033
"devDependencies": {
3134
"@commitlint/types": "^19.8.1",
35+
"@eslint/eslintrc": "^3.3.1",
3236
"@semantic-release/changelog": "^6.0.3",
3337
"@semantic-release/commit-analyzer": "^13.0.1",
3438
"@semantic-release/git": "^10.0.1",
3539
"@semantic-release/github": "^11.0.3",
3640
"@semantic-release/npm": "^12.0.2",
3741
"@semantic-release/release-notes-generator": "^14.0.3",
42+
"@stylistic/eslint-plugin": "^5.2.0",
3843
"@types/conventional-commits-parser": "^5.0.1",
3944
"@types/jest": "^30.0.0",
45+
"@typescript-eslint/eslint-plugin": "^8.37.0",
46+
"@typescript-eslint/parser": "^8.37.0",
47+
"eslint": "^9.31.0",
4048
"jest": "^29.7.0",
4149
"semantic-release": "^24.2.7",
4250
"ts-jest": "^29.4.0",
4351
"ts-node": "^10.9.2",
4452
"typescript": "^5.8.3"
4553
}
46-
}
54+
}

0 commit comments

Comments
 (0)