Skip to content

Commit 26f6692

Browse files
authored
Merge pull request #28 from MekDrop/fix/eslint-config
Fixed eslint config
2 parents 558fc9d + 90f19c8 commit 26f6692

File tree

4 files changed

+69
-16
lines changed

4 files changed

+69
-16
lines changed

eslint.config.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import jestPlugin from 'eslint-plugin-jest';
4+
5+
export default [
6+
// Base ESLint recommended rules
7+
js.configs.recommended,
8+
9+
// Main configuration
10+
{
11+
files: ['**/*.js'],
12+
languageOptions: {
13+
ecmaVersion: 2022,
14+
sourceType: 'module',
15+
globals: {
16+
...globals.node,
17+
...globals.es6,
18+
...globals.jest
19+
}
20+
},
21+
plugins: {
22+
jest: jestPlugin
23+
},
24+
rules: {
25+
// Core ESLint rules
26+
'semi': ['error', 'always'],
27+
'quotes': ['error', 'single', { 'avoidEscape': true }],
28+
'no-console': 'off',
29+
'no-unused-vars': ['error', { 'argsIgnorePattern': '^_' }],
30+
31+
// Jest plugin rules
32+
'jest/no-disabled-tests': 'warn',
33+
'jest/no-focused-tests': 'error',
34+
'jest/no-identical-title': 'error',
35+
'jest/prefer-to-have-length': 'warn',
36+
'jest/valid-expect': 'error'
37+
}
38+
},
39+
40+
// Ignore patterns (equivalent to .eslintignore)
41+
{
42+
ignores: [
43+
'node_modules/**',
44+
'dist/**',
45+
'coverage/**'
46+
]
47+
}
48+
];

package-lock.json

Lines changed: 18 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@
3333
"ejs": "^3.1.10"
3434
},
3535
"devDependencies": {
36-
"@vercel/ncc": "^0.38.1",
36+
"@eslint/js": "^9.25.0",
3737
"esbuild": "^0.25.2",
3838
"eslint": "^9.25.0",
3939
"eslint-plugin-jest": "^28.11.0",
40+
"globals": "^16.0.0",
4041
"jest": "^29.7.0",
4142
"mock-fs": "^5.5.0",
4243
"tmp-promise": "^3.0.3"

src/helpers/ComposerHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class ComposerHelper {
4343
await fs.access(classmapPath);
4444
return true;
4545
} catch (error) {
46-
throw new Error(`Could not find classmap at ${classmapPath}. Make sure you've run composer with the --optimize flag.`);
46+
throw new Error(`Could not find classmap at ${classmapPath}. Make sure you've run composer with the --optimize flag. Internal error: ${error}`);
4747
}
4848
}
4949
}

0 commit comments

Comments
 (0)