-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy patheslint.config.js
More file actions
68 lines (65 loc) · 1.43 KB
/
Copy patheslint.config.js
File metadata and controls
68 lines (65 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { fileURLToPath } from 'node:url';
import globals from 'globals';
import js from '@eslint/js';
import prettier from 'eslint-config-prettier';
import phpTemplates from 'eslint-plugin-php-templates';
import angularTemplateParser from '@angular-eslint/template-parser';
import tailwindcss from 'eslint-plugin-tailwindcss';
const tailwindRulesConfig = tailwindcss.configs['flat/recommended'].find(
(config) => config.name === 'tailwindcss:rules'
);
const tailwindRules = tailwindRulesConfig?.rules || {};
export default [
{
ignores: ['**/*.min.js', '**/vendor/'],
},
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 'latest',
},
rules: {
...js.configs.recommended.rules,
...prettier.rules,
},
},
{
files: ['javascript/**/*.js'],
languageOptions: {
globals: {
...globals.browser,
wp: 'readonly',
},
},
},
{
files: ['node_scripts/*.js', 'eslint.config.js', 'postcss.config.js'],
languageOptions: {
globals: {
...globals.node,
},
},
},
{
files: ['**/*.php'],
languageOptions: {
parser: phpTemplates.suppressParserErrors(angularTemplateParser),
},
plugins: {
'php-templates': phpTemplates,
tailwindcss,
},
processor: 'php-templates/strip-php',
rules: {
...tailwindRules,
'tailwindcss/no-custom-classname': 'off',
},
settings: {
tailwindcss: {
config: fileURLToPath(
new URL('./tailwind-intellisense.css', import.meta.url)
),
},
},
},
];