eureka-init 1.0.6 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
Binary file
@@ -29,6 +29,10 @@ function setup() {
29
29
  path.join(templateDir, '.eslintrc.js'),
30
30
  path.join(cwd, '.eslintrc.js')
31
31
  );
32
+ copyFile(
33
+ path.join(templateDir, 'lint-staged.config.js'),
34
+ path.join(cwd, 'lint-staged.config.js')
35
+ );
32
36
  copyFile(
33
37
  path.join(templateDir, 'jest.config.js'),
34
38
  path.join(cwd, 'jest.config.js')
@@ -97,6 +101,9 @@ function setup() {
97
101
  if (!pkg.scripts.test) {
98
102
  pkg.scripts.test = 'jest --passWithNoTests';
99
103
  }
104
+ if (!pkg.scripts['lint-staged']) {
105
+ pkg.scripts['lint-staged'] = 'lint-staged';
106
+ }
100
107
 
101
108
  fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
102
109
  console.log('✅ Updated package.json scripts');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eureka-init",
3
- "version": "1.0.6",
3
+ "version": "1.1.0",
4
4
  "description": "Shared configuration for Husky, Commitlint, Prettier, ESLint, and Jest for Eureka Group",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -16,7 +16,9 @@
16
16
  "husky",
17
17
  "commitlint",
18
18
  "prettier",
19
- "eureka"
19
+ "eureka",
20
+ "lint-staged",
21
+ "eslint-plugin-react"
20
22
  ],
21
23
  "author": "Eureka Group",
22
24
  "license": "ISC",
@@ -29,10 +31,12 @@
29
31
  "eslint": "^8.57.0",
30
32
  "eslint-config-prettier": "^9.1.0",
31
33
  "eslint-plugin-prettier": "^5.1.3",
34
+ "eslint-plugin-react": "^7.34.1",
32
35
  "husky": "^9.0.11",
36
+ "identity-obj-proxy": "^3.0.0",
33
37
  "jest": "^29.7.0",
34
38
  "jest-environment-jsdom": "^29.7.0",
35
- "identity-obj-proxy": "^3.0.0",
39
+ "lint-staged": "^15.2.2",
36
40
  "prettier": "^3.2.5"
37
41
  }
38
42
  }
@@ -6,14 +6,23 @@ module.exports = {
6
6
  },
7
7
  extends: [
8
8
  'eslint:recommended',
9
+ 'plugin:react/recommended',
9
10
  'plugin:prettier/recommended',
10
11
  ],
12
+ plugins: ['react'],
11
13
  parserOptions: {
12
14
  ecmaVersion: 'latest',
13
15
  sourceType: 'module',
14
16
  },
17
+ settings: {
18
+ react: {
19
+ version: 'detect',
20
+ },
21
+ },
15
22
  rules: {
16
23
  'no-console': 'warn',
17
24
  'prettier/prettier': 'error',
25
+ 'react/react-in-jsx-scope': 'off',
26
+ 'react/prop-types': 'off',
18
27
  },
19
28
  };
@@ -1,4 +1,4 @@
1
1
  #!/bin/sh
2
2
  . "$(dirname "$0")/_/husky.sh"
3
3
 
4
- npm run lint
4
+ npx lint-staged
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ // eslint --fix sudah otomatis menjalankan Prettier sekaligus memperbaiki linter
3
+ '*.{js,jsx,ts,tsx}': ['eslint --fix'],
4
+ // File non-JS/TS tetap menggunakan prettier secara langsung
5
+ '*.{json,css,scss,md}': ['prettier --write'],
6
+ };