Skip to content

Commit 4106212

Browse files
authored
Merge pull request #5 from laravel/eslint
ESLint
2 parents 682ad5e + 3ec1eb4 commit 4106212

File tree

15 files changed

+474
-2960
lines changed

15 files changed

+474
-2960
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/.phpunit.cache
2+
/bootstrap/ssr
23
/node_modules
34
/public/build
45
/public/hot

bootstrap/ssr/ssr-manifest.json

Lines changed: 0 additions & 46 deletions
This file was deleted.

bootstrap/ssr/ssr.js

Lines changed: 0 additions & 2745 deletions
This file was deleted.

eslint.config.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import js from '@eslint/js';
2+
import prettier from 'eslint-config-prettier';
3+
import react from 'eslint-plugin-react';
4+
import reactHooks from 'eslint-plugin-react-hooks';
5+
import globals from 'globals';
6+
import typescript from 'typescript-eslint';
7+
8+
/** @type {import('eslint').Linter.Config[]} */
9+
export default [
10+
js.configs.recommended,
11+
...typescript.configs.recommended,
12+
{
13+
...react.configs.flat.recommended,
14+
...react.configs.flat['jsx-runtime'], // Required for React 17+
15+
languageOptions: {
16+
globals: {
17+
...globals.browser,
18+
},
19+
},
20+
rules: {
21+
'react/react-in-jsx-scope': 'off',
22+
'react/prop-types': 'off',
23+
'react/no-unescaped-entities': 'off',
24+
},
25+
settings: {
26+
react: {
27+
version: 'detect',
28+
},
29+
},
30+
},
31+
{
32+
plugins: {
33+
'react-hooks': reactHooks,
34+
},
35+
rules: {
36+
'react-hooks/rules-of-hooks': 'error',
37+
'react-hooks/exhaustive-deps': 'warn',
38+
},
39+
},
40+
{
41+
ignores: ['vendor', 'node_modules', 'public', 'bootstrap/ssr', 'tailwind.config.js'],
42+
},
43+
prettier, // Turn off all rules that might conflict with Prettier
44+
];

0 commit comments

Comments
 (0)