@fullstacksjs/eslint-config 11.3.1 → 11.4.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 +1 -1
- package/cjs/index.js +3 -0
- package/cjs/modules/perfectionist.js +1 -2
- package/cjs/modules/tailwind.js +10 -2
- package/cjs/option.d.ts +1 -1
- package/package.json +1 -1
- package/src/index.mjs +4 -0
- package/src/modules/perfectionist.mjs +1 -2
- package/src/modules/tailwind.mjs +10 -2
- package/src/option.d.ts +1 -1
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@ interface Options {
|
|
|
62
62
|
cypress?: boolean; // controls cypress plugin
|
|
63
63
|
playwright?: boolean // controls playwright plugin
|
|
64
64
|
storybook?: boolean; // controls storybook plugin
|
|
65
|
-
tailwind?: boolean; // controls tailwindcss plugin
|
|
65
|
+
tailwind?: boolean | { callee?: string[] }; // controls tailwindcss plugin
|
|
66
66
|
next?: boolean; // controls next plugin
|
|
67
67
|
prettier?: boolean; // controls prettier plugin
|
|
68
68
|
disableExpensiveRules?: boolean; // controls expensive rules
|
package/cjs/index.js
CHANGED
|
@@ -62,6 +62,9 @@ const defaultOptions = {
|
|
|
62
62
|
*/
|
|
63
63
|
function init(initOptions = {}, ...extend) {
|
|
64
64
|
const options = (0, _deepmerge.default)(defaultOptions, initOptions);
|
|
65
|
+
if (options.tailwind === true) {
|
|
66
|
+
options.tailwind = {};
|
|
67
|
+
}
|
|
65
68
|
if (options.typescript === true) {
|
|
66
69
|
options.typescript = {};
|
|
67
70
|
}
|
|
@@ -16,9 +16,8 @@ function perfectionist() {
|
|
|
16
16
|
},
|
|
17
17
|
rules: {
|
|
18
18
|
'perfectionist/sort-array-includes': 'warn',
|
|
19
|
-
'perfectionist/sort-astro-attributes': 'warn',
|
|
20
19
|
'perfectionist/sort-classes': 'warn',
|
|
21
|
-
'perfectionist/sort-enums': '
|
|
20
|
+
'perfectionist/sort-enums': 'off',
|
|
22
21
|
'perfectionist/sort-exports': 'warn',
|
|
23
22
|
'perfectionist/sort-imports': ['warn', {}],
|
|
24
23
|
'perfectionist/sort-interfaces': 'off',
|
package/cjs/modules/tailwind.js
CHANGED
|
@@ -4,13 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @param { import('../option').Options } options
|
|
9
|
+
* @return { Promise<import('eslint').Linter.Config> }
|
|
10
|
+
*/
|
|
11
|
+
async function tailwind(options = {}) {
|
|
9
12
|
const plugin = await Promise.resolve().then(() => require('eslint-plugin-tailwindcss'));
|
|
10
13
|
return {
|
|
11
14
|
plugins: {
|
|
12
15
|
tailwindcss: plugin.default ?? plugin
|
|
13
16
|
},
|
|
17
|
+
settings: {
|
|
18
|
+
tailwindcss: {
|
|
19
|
+
callees: options.callees ?? ['cva', 'classnames', 'classNames', 'class', 'clsx', 'cn', 'cns', 'cx']
|
|
20
|
+
}
|
|
21
|
+
},
|
|
14
22
|
rules: {
|
|
15
23
|
'tailwindcss/classnames-order': 'warn',
|
|
16
24
|
'tailwindcss/enforces-negative-arbitrary-values': 'warn',
|
package/cjs/option.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface Options extends Linter.Config {
|
|
|
4
4
|
react?: boolean;
|
|
5
5
|
sort?: boolean;
|
|
6
6
|
next?: boolean;
|
|
7
|
-
tailwind?: boolean;
|
|
7
|
+
tailwind?: boolean | { callees: string[] };
|
|
8
8
|
node?: boolean;
|
|
9
9
|
strict?: boolean;
|
|
10
10
|
import?: { internalRegExp?: string; lifetime?: number; projects?: string | string[] } | boolean;
|
package/package.json
CHANGED
package/src/index.mjs
CHANGED
|
@@ -55,6 +55,10 @@ const defaultOptions = {
|
|
|
55
55
|
*/
|
|
56
56
|
export function init(initOptions = {}, ...extend) {
|
|
57
57
|
const options = merge(defaultOptions, initOptions);
|
|
58
|
+
|
|
59
|
+
if (options.tailwind === true) {
|
|
60
|
+
options.tailwind = {};
|
|
61
|
+
}
|
|
58
62
|
if (options.typescript === true) {
|
|
59
63
|
options.typescript = {};
|
|
60
64
|
}
|
|
@@ -8,9 +8,8 @@ function perfectionist() {
|
|
|
8
8
|
plugins: { perfectionist: plugin },
|
|
9
9
|
rules: {
|
|
10
10
|
'perfectionist/sort-array-includes': 'warn',
|
|
11
|
-
'perfectionist/sort-astro-attributes': 'warn',
|
|
12
11
|
'perfectionist/sort-classes': 'warn',
|
|
13
|
-
'perfectionist/sort-enums': '
|
|
12
|
+
'perfectionist/sort-enums': 'off',
|
|
14
13
|
'perfectionist/sort-exports': 'warn',
|
|
15
14
|
'perfectionist/sort-imports': ['warn', {}],
|
|
16
15
|
'perfectionist/sort-interfaces': 'off',
|
package/src/modules/tailwind.mjs
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @param { import('../option').Options } options
|
|
3
|
+
* @return { Promise<import('eslint').Linter.Config> }
|
|
4
|
+
*/
|
|
5
|
+
async function tailwind(options = {}) {
|
|
3
6
|
const plugin = await import('eslint-plugin-tailwindcss');
|
|
4
7
|
return {
|
|
5
8
|
plugins: { tailwindcss: plugin.default ?? plugin },
|
|
9
|
+
settings: {
|
|
10
|
+
tailwindcss: {
|
|
11
|
+
callees: options.callees ?? ['cva', 'classnames', 'classNames', 'class', 'clsx', 'cn', 'cns', 'cx'],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
6
14
|
rules: {
|
|
7
15
|
'tailwindcss/classnames-order': 'warn',
|
|
8
16
|
'tailwindcss/enforces-negative-arbitrary-values': 'warn',
|
package/src/option.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface Options extends Linter.Config {
|
|
|
4
4
|
react?: boolean;
|
|
5
5
|
sort?: boolean;
|
|
6
6
|
next?: boolean;
|
|
7
|
-
tailwind?: boolean;
|
|
7
|
+
tailwind?: boolean | { callees: string[] };
|
|
8
8
|
node?: boolean;
|
|
9
9
|
strict?: boolean;
|
|
10
10
|
import?: { internalRegExp?: string; lifetime?: number; projects?: string | string[] } | boolean;
|