Skip to content

Commit 26b721d

Browse files
committed
Fix ESLint tests
1 parent 316fedd commit 26b721d

File tree

4 files changed

+38
-38
lines changed

4 files changed

+38
-38
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ trim_trailing_whitespace = true
1111
[*.md]
1212
trim_trailing_whitespace = false
1313

14-
[*.yml]
15-
indent_size = 2
14+
[{*.yml,*.js}]
15+
indent_size = 2

composer.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@
2222
],
2323
"require": {
2424
"php": "^8.1",
25-
"illuminate/config": "^10 || ^11",
26-
"illuminate/console": "^10 || ^11",
27-
"illuminate/container": "^10 || ^11",
28-
"illuminate/contracts": "^10 || ^11",
29-
"illuminate/pipeline": "^10 || ^11",
30-
"illuminate/support": "^10 || ^11"
25+
"illuminate/config": "^10.0|^11.0",
26+
"illuminate/console": "^10.0|^11.0",
27+
"illuminate/container": "^10.0|^11.0",
28+
"illuminate/contracts": "^10.0|^11.0",
29+
"illuminate/pipeline": "^10.0|^11.0",
30+
"illuminate/support": "^10.0|^11.0"
3131
},
3232
"require-dev": {
33-
"enlightn/enlightn": "^2",
34-
"larastan/larastan": "^2",
35-
"laravel/pint": "^1",
36-
"mockery/mockery": "^1",
37-
"nunomaduro/phpinsights": "^2",
38-
"orchestra/testbench": "^v8 || ^v9",
39-
"pestphp/pest": "^2 || ^3",
40-
"pestphp/pest-plugin-laravel": "^2 || ^3",
41-
"rector/rector": "^1 || ^2 || ^3",
42-
"squizlabs/php_codesniffer": "^3"
33+
"enlightn/enlightn": "^2.3",
34+
"larastan/larastan": "^2.9",
35+
"laravel/pint": "^1.2",
36+
"mockery/mockery": "^1.6.1",
37+
"nunomaduro/phpinsights": "^2.12",
38+
"orchestra/testbench": "^v8.0.0|^v9.0.0",
39+
"pestphp/pest": "^2.0|^3.0",
40+
"pestphp/pest-plugin-laravel": "^2.0 | ^3.0",
41+
"rector/rector": "^1.0 | ^2.0 | ^3.0",
42+
"squizlabs/php_codesniffer": "^3.11.0"
4343
},
4444
"autoload": {
4545
"psr-4": {

tests/Features/Commands/Hooks/ESLintPreCommitHookTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ function ($eslintConfiguration, $listOfFixableNonJSFiles) {
8787
$this->artisan('git-hooks:pre-commit')
8888
->doesntExpectOutputToContain('ESLint Failed')
8989
->assertSuccessful();
90-
})->with('eslintConfiguration', 'listOfFixableJSFiles')->skip();
90+
})->with('eslintConfiguration', 'listOfFixableJSFiles');

tests/Fixtures/.eslintrcFixture.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
export default [
1+
module.exports = [
22
{
3-
files: ["**/*.js"], // Target only JavaScript files
3+
files: ['**/*.{js,jsx,mjs,cjs,vue}'],
44
languageOptions: {
5-
ecmaVersion: "latest", // Use the latest ECMAScript features
6-
sourceType: "module", // Enable ES Modules
5+
ecmaVersion: 'latest',
6+
sourceType: 'module',
77
globals: {
8-
window: true,
9-
document: true,
10-
console: true,
11-
navigator: true,
12-
process: true,
13-
module: true,
14-
},
8+
browser: true
9+
}
1510
},
1611
rules: {
17-
// General JavaScript rules
18-
"no-unused-vars": "warn", // Warn about unused variables
19-
"no-console": "warn", // Warn about console statements
20-
"semi": ["error", "always"], // Enforce semicolons
21-
"indent": ["error", 2], // Enforce 2-space indentation
22-
"quotes": ["error", "double"], // Enforce double quotes
23-
},
24-
},
12+
// Auto-fixable rules to catch issues in fixable-js-file.js
13+
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
14+
'no-multiple-empty-lines': ['error', { max: 1 }],
15+
'padded-blocks': ['error', 'never'],
16+
'space-before-blocks': ['error', 'always'],
17+
'space-before-function-paren': ['error', 'never'],
18+
19+
// Non-fixable rules to not fix in not-fully-fixable-js-file.js
20+
'no-unused-vars': 'error',
21+
'complexity': ['error', 1],
22+
'no-empty-function': 'error'
23+
}
24+
}
2525
];

0 commit comments

Comments
 (0)