@fullstacksjs/eslint-config 12.2.0 → 12.3.1-next.1
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 +2 -2
- package/cjs/{option.d.ts → index.d.ts} +14 -4
- package/cjs/index.js +1 -9
- package/cjs/modules/base.js +2 -2
- package/cjs/modules/ignore.js +1 -1
- package/cjs/modules/imports.js +1 -1
- package/cjs/modules/jest.js +1 -1
- package/cjs/modules/node.js +1 -1
- package/cjs/modules/stylistic.js +1 -1
- package/cjs/modules/tailwind.js +14 -12
- package/cjs/modules/tests.js +1 -1
- package/cjs/modules/typescript.js +1 -1
- package/package.json +4 -3
- package/src/{option.d.ts → index.d.ts} +14 -4
- package/src/index.mjs +2 -8
- package/src/modules/base.mjs +2 -2
- package/src/modules/ignore.mjs +1 -1
- package/src/modules/imports.mjs +1 -1
- package/src/modules/jest.mjs +1 -1
- package/src/modules/node.mjs +1 -1
- package/src/modules/stylistic.mjs +1 -1
- package/src/modules/tailwind.mjs +12 -12
- package/src/modules/tests.mjs +1 -1
- package/src/modules/typescript.mjs +1 -1
package/README.md
CHANGED
|
@@ -69,7 +69,7 @@ interface Options {
|
|
|
69
69
|
cypress?: boolean; // controls cypress plugin
|
|
70
70
|
playwright?: boolean // controls playwright plugin
|
|
71
71
|
storybook?: boolean; // controls storybook plugin
|
|
72
|
-
tailwind?:
|
|
72
|
+
tailwind?: false | TailwindConfig; // controls tailwindcss plugin
|
|
73
73
|
next?: boolean; // controls next plugin
|
|
74
74
|
prettier?: boolean; // controls prettier plugin
|
|
75
75
|
disableExpensiveRules?: boolean; // controls expensive rules
|
|
@@ -177,7 +177,7 @@ export default defineConfig({
|
|
|
177
177
|
* [eslint-plugin-promise](https://github.com/eslint-community/eslint-plugin-promise)
|
|
178
178
|
* [eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks)
|
|
179
179
|
* [eslint-plugin-storybook](https://github.com/storybookjs/eslint-plugin-storybook#readme)
|
|
180
|
-
* [eslint-plugin-tailwindcss](https://github.com/
|
|
180
|
+
* [eslint-plugin-better-tailwindcss](https://github.com/schoero/eslint-plugin-better-tailwindcss)
|
|
181
181
|
* [eslint-plugin-vitest](https://www.npmjs.com/package/eslint-plugin-vitest)
|
|
182
182
|
* [typescript-eslint](https://typescript-eslint.io/)
|
|
183
183
|
|
|
@@ -7,6 +7,13 @@ interface ProjectService {
|
|
|
7
7
|
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: number;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
type TailwindConfig = {
|
|
11
|
+
callees: string[];
|
|
12
|
+
variables?: string[];
|
|
13
|
+
attributes?: string[];
|
|
14
|
+
tags?: string[];
|
|
15
|
+
} & ({ entryPoint: string; tailwindConfig?: string } | { entryPoint?: string; tailwindConfig: string });
|
|
16
|
+
|
|
10
17
|
export interface Options extends Linter.Config {
|
|
11
18
|
/**
|
|
12
19
|
* @default true if you have `react` or `react-dom` in your dependencies
|
|
@@ -23,10 +30,11 @@ export interface Options extends Linter.Config {
|
|
|
23
30
|
*/
|
|
24
31
|
next?: boolean;
|
|
25
32
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
33
|
+
* Controls Tailwind plugin.
|
|
34
|
+
* @default false
|
|
35
|
+
* @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md
|
|
28
36
|
*/
|
|
29
|
-
tailwind?:
|
|
37
|
+
tailwind?: false | TailwindConfig;
|
|
30
38
|
/**
|
|
31
39
|
* @default false
|
|
32
40
|
* Controls [node plugin](https://www.npmjs.com/package/eslint-plugin-n).
|
|
@@ -98,4 +106,6 @@ export interface Options extends Linter.Config {
|
|
|
98
106
|
ignores?: string[];
|
|
99
107
|
}
|
|
100
108
|
|
|
101
|
-
export declare
|
|
109
|
+
export declare function defineConfig(initOptions?: Options, ...extend: Linter.Config[]): Linter.Config[];
|
|
110
|
+
|
|
111
|
+
export declare const init: typeof defineConfig;
|
package/cjs/index.js
CHANGED
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.defineConfig = defineConfig;
|
|
7
|
-
exports.init = void 0;
|
|
8
7
|
var _deepmerge = _interopRequireDefault(require("deepmerge"));
|
|
9
8
|
var _config = require("eslint/config");
|
|
10
9
|
var _localPkg = require("local-pkg");
|
|
@@ -30,7 +29,7 @@ const testPackages = ['jest', 'vitest', 'cypress', 'playwright'];
|
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
31
|
* @typedef {import('eslint').Linter.Config} Config
|
|
33
|
-
* @typedef {import('./
|
|
32
|
+
* @typedef {import('./index.js').Options} Options
|
|
34
33
|
* /
|
|
35
34
|
|
|
36
35
|
/** @type {Options} */
|
|
@@ -50,7 +49,6 @@ const defaultOptions = {
|
|
|
50
49
|
storybook: (0, _localPkg.isPackageExists)('storybook'),
|
|
51
50
|
strict: false,
|
|
52
51
|
tailwind: false,
|
|
53
|
-
// ISSUE: https://github.com/francoismassart/eslint-plugin-tailwindcss/issues/325,
|
|
54
52
|
test: testPackages.some(p => (0, _localPkg.isPackageExists)(p)),
|
|
55
53
|
typescript: (0, _localPkg.isPackageExists)('typescript') ? {
|
|
56
54
|
projectService: true
|
|
@@ -66,9 +64,6 @@ const defaultOptions = {
|
|
|
66
64
|
*/
|
|
67
65
|
function defineConfig(initOptions = {}, ...extend) {
|
|
68
66
|
const options = (0, _deepmerge.default)(defaultOptions, initOptions);
|
|
69
|
-
if (options.tailwind === true) {
|
|
70
|
-
options.tailwind = {};
|
|
71
|
-
}
|
|
72
67
|
if (options.import === true) {
|
|
73
68
|
options.import = {};
|
|
74
69
|
}
|
|
@@ -112,6 +107,3 @@ function defineConfig(initOptions = {}, ...extend) {
|
|
|
112
107
|
if (extend) Array.prototype.push.apply(rules, extend);
|
|
113
108
|
return (0, _config.defineConfig)(rules);
|
|
114
109
|
}
|
|
115
|
-
|
|
116
|
-
/** @deprecated Please use `defineConfig` from `@fullstacksjs/eslint-config` instead, this function will be removed in the next major release */
|
|
117
|
-
const init = exports.init = defineConfig;
|
package/cjs/modules/base.js
CHANGED
|
@@ -8,7 +8,7 @@ var _globals = _interopRequireDefault(require("globals"));
|
|
|
8
8
|
var _conditions = require("../utils/conditions.js");
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
/**
|
|
11
|
-
* @param { import('../
|
|
11
|
+
* @param { import('../index.js').Options } options
|
|
12
12
|
* @return { import('eslint').Linter.Config }
|
|
13
13
|
*/
|
|
14
14
|
function base(options = {}) {
|
|
@@ -19,7 +19,7 @@ function base(options = {}) {
|
|
|
19
19
|
globals: {
|
|
20
20
|
..._globals.default.browser,
|
|
21
21
|
..._globals.default.node,
|
|
22
|
-
..._globals.default.
|
|
22
|
+
..._globals.default.es2025
|
|
23
23
|
},
|
|
24
24
|
parserOptions: {
|
|
25
25
|
ecmaVersion: 'latest',
|
package/cjs/modules/ignore.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
var _config = require("eslint/config");
|
|
8
8
|
var _globs = require("../utils/globs.js");
|
|
9
9
|
/**
|
|
10
|
-
* @param { import('../
|
|
10
|
+
* @param { import('../index.js').Options } options
|
|
11
11
|
* @return { import('eslint').Linter.Config }
|
|
12
12
|
*/
|
|
13
13
|
function ignores(options = {}) {
|
package/cjs/modules/imports.js
CHANGED
|
@@ -12,7 +12,7 @@ const jsExtensions = ['.mjs', '.js', '.jsx', '.cjs'];
|
|
|
12
12
|
const allExtensions = [...jsExtensions, ...tsExtensions];
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* @param { import('../
|
|
15
|
+
* @param { import('../index.js').Options } options
|
|
16
16
|
* @return { import('eslint').Linter.Config }
|
|
17
17
|
*/
|
|
18
18
|
function imports(options = {}) {
|
package/cjs/modules/jest.js
CHANGED
|
@@ -8,7 +8,7 @@ var _eslintPluginJest = _interopRequireDefault(require("eslint-plugin-jest"));
|
|
|
8
8
|
var _globs = require("../utils/globs.js");
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
/**
|
|
11
|
-
* @param { import('../
|
|
11
|
+
* @param { import('../index.js').Options } options
|
|
12
12
|
* @return { import('eslint').Linter.Config } */
|
|
13
13
|
function jest() {
|
|
14
14
|
return {
|
package/cjs/modules/node.js
CHANGED
|
@@ -8,7 +8,7 @@ var _eslintPluginN = _interopRequireDefault(require("eslint-plugin-n"));
|
|
|
8
8
|
var _conditions = require("../utils/conditions.js");
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
/**
|
|
11
|
-
* @param { import('../
|
|
11
|
+
* @param { import('../index.js').Options } options
|
|
12
12
|
* @return { import('eslint').Linter.Config }
|
|
13
13
|
*/
|
|
14
14
|
function node(options = {}) {
|
package/cjs/modules/stylistic.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
var _eslintPlugin = _interopRequireDefault(require("@stylistic/eslint-plugin"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
/**
|
|
10
|
-
* @param { import('../
|
|
10
|
+
* @param { import('../index.js').Options } options
|
|
11
11
|
* @return { Promise<import('eslint').Linter.Config> }
|
|
12
12
|
*/
|
|
13
13
|
function stylistic() {
|
package/cjs/modules/tailwind.js
CHANGED
|
@@ -5,28 +5,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* @param { import('../
|
|
8
|
+
* @param { import('../index.js').Options } options
|
|
9
9
|
* @return { Promise<import('eslint').Linter.Config> }
|
|
10
10
|
*/
|
|
11
11
|
async function tailwind(options = {}) {
|
|
12
|
-
const plugin = await Promise.resolve().then(() => require('eslint-plugin-tailwindcss'));
|
|
12
|
+
const plugin = await Promise.resolve().then(() => require('eslint-plugin-better-tailwindcss'));
|
|
13
13
|
return {
|
|
14
14
|
plugins: {
|
|
15
|
-
tailwindcss: plugin.default ?? plugin
|
|
15
|
+
'better-tailwindcss': plugin.default ?? plugin
|
|
16
16
|
},
|
|
17
17
|
settings: {
|
|
18
|
-
tailwindcss: {
|
|
19
|
-
|
|
18
|
+
'better-tailwindcss': {
|
|
19
|
+
entryPoint: options.entryPoint,
|
|
20
|
+
tailwindConfig: options.tailwindConfig
|
|
20
21
|
}
|
|
21
22
|
},
|
|
22
23
|
rules: {
|
|
23
|
-
'tailwindcss/
|
|
24
|
-
'tailwindcss/
|
|
25
|
-
'tailwindcss/
|
|
26
|
-
'tailwindcss/
|
|
27
|
-
'tailwindcss/
|
|
28
|
-
'tailwindcss/
|
|
29
|
-
|
|
24
|
+
'better-tailwindcss/sort-classes': 'warn',
|
|
25
|
+
'better-tailwindcss/no-duplicate-classes': 'error',
|
|
26
|
+
'better-tailwindcss/no-conflicting-classes': 'error',
|
|
27
|
+
'better-tailwindcss/no-unnecessary-whitespace': 'warn',
|
|
28
|
+
'better-tailwindcss/enforce-consistent-variable-syntax': 'error',
|
|
29
|
+
'better-tailwindcss/multiline': ['error', {
|
|
30
|
+
printWidth: 140
|
|
31
|
+
}]
|
|
30
32
|
}
|
|
31
33
|
};
|
|
32
34
|
}
|
package/cjs/modules/tests.js
CHANGED
|
@@ -10,7 +10,7 @@ var _conditions = require("../utils/conditions.js");
|
|
|
10
10
|
var _globs = require("../utils/globs.js");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
/**
|
|
13
|
-
* @param { import('../
|
|
13
|
+
* @param { import('../index.js').Options } options
|
|
14
14
|
* @return { import('eslint').Linter.Config }
|
|
15
15
|
*/
|
|
16
16
|
function tests(options = {}) {
|
|
@@ -9,7 +9,7 @@ var _conditions = require("../utils/conditions.js");
|
|
|
9
9
|
var _globs = require("../utils/globs.js");
|
|
10
10
|
var _namingConvention = require("../utils/naming-convention.js");
|
|
11
11
|
/**
|
|
12
|
-
* @param { import('../
|
|
12
|
+
* @param { import('../index.js').Options } options
|
|
13
13
|
* @return { import('eslint').Linter.Config }
|
|
14
14
|
*/
|
|
15
15
|
function typescript(options = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullstacksjs/eslint-config",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.3.1-next.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "fullstacks <fullstacksjs@gmail.com>",
|
|
6
6
|
"description": "fullstacks eslint config",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"exports": {
|
|
31
31
|
".": {
|
|
32
32
|
"import": "./src/index.mjs",
|
|
33
|
-
"require": "./cjs/index.js"
|
|
33
|
+
"require": "./cjs/index.js",
|
|
34
|
+
"types": "./src/index.d.ts"
|
|
34
35
|
}
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
"@next/eslint-plugin-next": "15.3.2",
|
|
39
40
|
"@stylistic/eslint-plugin": "4.4.0",
|
|
40
41
|
"deepmerge": "4.3.1",
|
|
42
|
+
"eslint-plugin-better-tailwindcss": "3.2.1",
|
|
41
43
|
"eslint-plugin-cypress": "4.3.0",
|
|
42
44
|
"eslint-plugin-import-x": "4.13.3",
|
|
43
45
|
"eslint-plugin-jest": "28.11.0",
|
|
@@ -50,7 +52,6 @@
|
|
|
50
52
|
"eslint-plugin-promise": "7.2.1",
|
|
51
53
|
"eslint-plugin-react-hooks": "5.2.0",
|
|
52
54
|
"eslint-plugin-storybook": "0.12.0",
|
|
53
|
-
"eslint-plugin-tailwindcss": "3.18.0",
|
|
54
55
|
"eslint-plugin-vitest": "0.5.4",
|
|
55
56
|
"globals": "16.2.0",
|
|
56
57
|
"local-pkg": "1.1.1",
|
|
@@ -7,6 +7,13 @@ interface ProjectService {
|
|
|
7
7
|
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: number;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
type TailwindConfig = {
|
|
11
|
+
callees: string[];
|
|
12
|
+
variables?: string[];
|
|
13
|
+
attributes?: string[];
|
|
14
|
+
tags?: string[];
|
|
15
|
+
} & ({ entryPoint: string; tailwindConfig?: string } | { entryPoint?: string; tailwindConfig: string });
|
|
16
|
+
|
|
10
17
|
export interface Options extends Linter.Config {
|
|
11
18
|
/**
|
|
12
19
|
* @default true if you have `react` or `react-dom` in your dependencies
|
|
@@ -23,10 +30,11 @@ export interface Options extends Linter.Config {
|
|
|
23
30
|
*/
|
|
24
31
|
next?: boolean;
|
|
25
32
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
33
|
+
* Controls Tailwind plugin.
|
|
34
|
+
* @default false
|
|
35
|
+
* @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md
|
|
28
36
|
*/
|
|
29
|
-
tailwind?:
|
|
37
|
+
tailwind?: false | TailwindConfig;
|
|
30
38
|
/**
|
|
31
39
|
* @default false
|
|
32
40
|
* Controls [node plugin](https://www.npmjs.com/package/eslint-plugin-n).
|
|
@@ -98,4 +106,6 @@ export interface Options extends Linter.Config {
|
|
|
98
106
|
ignores?: string[];
|
|
99
107
|
}
|
|
100
108
|
|
|
101
|
-
export declare
|
|
109
|
+
export declare function defineConfig(initOptions?: Options, ...extend: Linter.Config[]): Linter.Config[];
|
|
110
|
+
|
|
111
|
+
export declare const init: typeof defineConfig;
|
package/src/index.mjs
CHANGED
|
@@ -24,7 +24,7 @@ const testPackages = ['jest', 'vitest', 'cypress', 'playwright'];
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* @typedef {import('eslint').Linter.Config} Config
|
|
27
|
-
* @typedef {import('
|
|
27
|
+
* @typedef {import('.').Options} Options
|
|
28
28
|
* /
|
|
29
29
|
|
|
30
30
|
/** @type {Options} */
|
|
@@ -43,7 +43,7 @@ const defaultOptions = {
|
|
|
43
43
|
react: isPackageExists('react'),
|
|
44
44
|
storybook: isPackageExists('storybook'),
|
|
45
45
|
strict: false,
|
|
46
|
-
tailwind: false,
|
|
46
|
+
tailwind: false,
|
|
47
47
|
test: testPackages.some(p => isPackageExists(p)),
|
|
48
48
|
typescript: isPackageExists('typescript') ? { projectService: true } : false,
|
|
49
49
|
vitest: isPackageExists('vitest'),
|
|
@@ -58,9 +58,6 @@ const defaultOptions = {
|
|
|
58
58
|
export function defineConfig(initOptions = {}, ...extend) {
|
|
59
59
|
const options = merge(defaultOptions, initOptions);
|
|
60
60
|
|
|
61
|
-
if (options.tailwind === true) {
|
|
62
|
-
options.tailwind = {};
|
|
63
|
-
}
|
|
64
61
|
if (options.import === true) {
|
|
65
62
|
options.import = {};
|
|
66
63
|
}
|
|
@@ -109,6 +106,3 @@ export function defineConfig(initOptions = {}, ...extend) {
|
|
|
109
106
|
|
|
110
107
|
return eslintConfig(rules);
|
|
111
108
|
}
|
|
112
|
-
|
|
113
|
-
/** @deprecated Please use `defineConfig` from `@fullstacksjs/eslint-config` instead, this function will be removed in the next major release */
|
|
114
|
-
export const init = defineConfig;
|
package/src/modules/base.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import globals from 'globals';
|
|
|
3
3
|
import { strict } from '../utils/conditions.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @param { import('
|
|
6
|
+
* @param { import('..').Options } options
|
|
7
7
|
* @return { import('eslint').Linter.Config }
|
|
8
8
|
*/
|
|
9
9
|
function base(options = {}) {
|
|
@@ -14,7 +14,7 @@ function base(options = {}) {
|
|
|
14
14
|
globals: {
|
|
15
15
|
...globals.browser,
|
|
16
16
|
...globals.node,
|
|
17
|
-
...globals.
|
|
17
|
+
...globals.es2025,
|
|
18
18
|
},
|
|
19
19
|
parserOptions: {
|
|
20
20
|
ecmaVersion: 'latest',
|
package/src/modules/ignore.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { globalIgnores } from 'eslint/config';
|
|
|
2
2
|
|
|
3
3
|
import { ignoreGlobs } from '../utils/globs.mjs';
|
|
4
4
|
/**
|
|
5
|
-
* @param { import('
|
|
5
|
+
* @param { import('..').Options } options
|
|
6
6
|
* @return { import('eslint').Linter.Config }
|
|
7
7
|
*/
|
|
8
8
|
function ignores(options = {}) {
|
package/src/modules/imports.mjs
CHANGED
|
@@ -7,7 +7,7 @@ const jsExtensions = ['.mjs', '.js', '.jsx', '.cjs'];
|
|
|
7
7
|
const allExtensions = [...jsExtensions, ...tsExtensions];
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* @param { import('
|
|
10
|
+
* @param { import('..').Options } options
|
|
11
11
|
* @return { import('eslint').Linter.Config }
|
|
12
12
|
*/
|
|
13
13
|
function imports(options = {}) {
|
package/src/modules/jest.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import plugin from 'eslint-plugin-jest';
|
|
|
3
3
|
import { globs } from '../utils/globs.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @param { import('
|
|
6
|
+
* @param { import('..').Options } options
|
|
7
7
|
* @return { import('eslint').Linter.Config } */
|
|
8
8
|
function jest() {
|
|
9
9
|
return {
|
package/src/modules/node.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import plugin from 'eslint-plugin-n';
|
|
|
3
3
|
import { strict } from '../utils/conditions.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @param { import('
|
|
6
|
+
* @param { import('..').Options } options
|
|
7
7
|
* @return { import('eslint').Linter.Config }
|
|
8
8
|
*/
|
|
9
9
|
function node(options = {}) {
|
package/src/modules/tailwind.mjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @param { import('
|
|
2
|
+
* @param { import('..').Options } options
|
|
3
3
|
* @return { Promise<import('eslint').Linter.Config> }
|
|
4
4
|
*/
|
|
5
5
|
async function tailwind(options = {}) {
|
|
6
|
-
const plugin = await import('eslint-plugin-tailwindcss');
|
|
6
|
+
const plugin = await import('eslint-plugin-better-tailwindcss');
|
|
7
7
|
return {
|
|
8
|
-
plugins: { tailwindcss: plugin.default ?? plugin },
|
|
8
|
+
plugins: { 'better-tailwindcss': plugin.default ?? plugin },
|
|
9
9
|
settings: {
|
|
10
|
-
tailwindcss: {
|
|
11
|
-
|
|
10
|
+
'better-tailwindcss': {
|
|
11
|
+
entryPoint: options.entryPoint,
|
|
12
|
+
tailwindConfig: options.tailwindConfig,
|
|
12
13
|
},
|
|
13
14
|
},
|
|
14
15
|
rules: {
|
|
15
|
-
'tailwindcss/
|
|
16
|
-
'tailwindcss/
|
|
17
|
-
'tailwindcss/
|
|
18
|
-
'tailwindcss/
|
|
19
|
-
'tailwindcss/
|
|
20
|
-
'tailwindcss/
|
|
21
|
-
'tailwindcss/no-contradicting-classname': 'error',
|
|
16
|
+
'better-tailwindcss/sort-classes': 'warn',
|
|
17
|
+
'better-tailwindcss/no-duplicate-classes': 'error',
|
|
18
|
+
'better-tailwindcss/no-conflicting-classes': 'error',
|
|
19
|
+
'better-tailwindcss/no-unnecessary-whitespace': 'warn',
|
|
20
|
+
'better-tailwindcss/enforce-consistent-variable-syntax': 'error',
|
|
21
|
+
'better-tailwindcss/multiline': ['error', { printWidth: 140 }],
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
24
|
}
|
package/src/modules/tests.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { predicate } from '../utils/conditions.mjs';
|
|
|
5
5
|
import { globs } from '../utils/globs.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* @param { import('
|
|
8
|
+
* @param { import('..').Options } options
|
|
9
9
|
* @return { import('eslint').Linter.Config }
|
|
10
10
|
*/
|
|
11
11
|
function tests(options = {}) {
|
|
@@ -5,7 +5,7 @@ import { globs } from '../utils/globs.mjs';
|
|
|
5
5
|
import { namingConvention } from '../utils/naming-convention.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* @param { import('
|
|
8
|
+
* @param { import('..').Options } options
|
|
9
9
|
* @return { import('eslint').Linter.Config }
|
|
10
10
|
*/
|
|
11
11
|
function typescript(options = {}) {
|