@icebreakers/eslint-config 0.1.0 → 0.2.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/dist/index.cjs +11 -2
- package/dist/index.d.cts +3 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +11 -2
- package/package.json +9 -3
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
|
|
4
|
+
const eslintrc = require('@eslint/eslintrc');
|
|
5
|
+
const localPkg = require('local-pkg');
|
|
4
6
|
const eslintConfig = require('@antfu/eslint-config');
|
|
5
7
|
|
|
6
8
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
7
9
|
|
|
8
10
|
const eslintPluginPrettierRecommended__default = /*#__PURE__*/_interopDefaultCompat(eslintPluginPrettierRecommended);
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
const compat = new eslintrc.FlatCompat();
|
|
13
|
+
function icebreaker(options = {}, ...userConfigs) {
|
|
14
|
+
const { prettier, tailwindcss: enableTailwindcss = localPkg.isPackageExists("tailwindcss"), ...opts } = options;
|
|
11
15
|
const presets = [
|
|
12
16
|
{
|
|
13
17
|
rules: {
|
|
@@ -21,7 +25,12 @@ function icebreaker(options, ...userConfigs) {
|
|
|
21
25
|
if (options?.prettier) {
|
|
22
26
|
presets.push(eslintPluginPrettierRecommended__default);
|
|
23
27
|
}
|
|
24
|
-
|
|
28
|
+
if (enableTailwindcss) {
|
|
29
|
+
presets.push(...compat.config({
|
|
30
|
+
extends: ["plugin:tailwindcss/recommended"]
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
return eslintConfig.antfu(opts, ...presets, ...userConfigs);
|
|
25
34
|
}
|
|
26
35
|
|
|
27
36
|
exports.icebreaker = icebreaker;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { Linter } from 'eslint';
|
|
2
1
|
import { OptionsConfig, TypedFlatConfigItem, Awaitable, ConfigNames } from '@antfu/eslint-config';
|
|
3
2
|
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
3
|
+
import { Linter } from 'eslint';
|
|
4
4
|
|
|
5
5
|
type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem & {
|
|
6
6
|
prettier?: boolean;
|
|
7
|
+
tailwindcss?: boolean;
|
|
7
8
|
};
|
|
8
9
|
type UserConfigItem = Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.FlatConfig[]>;
|
|
10
|
+
|
|
9
11
|
declare function icebreaker(options?: UserDefinedOptions, ...userConfigs: UserConfigItem[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
10
12
|
|
|
11
13
|
export { type UserConfigItem, type UserDefinedOptions, icebreaker };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { Linter } from 'eslint';
|
|
2
1
|
import { OptionsConfig, TypedFlatConfigItem, Awaitable, ConfigNames } from '@antfu/eslint-config';
|
|
3
2
|
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
3
|
+
import { Linter } from 'eslint';
|
|
4
4
|
|
|
5
5
|
type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem & {
|
|
6
6
|
prettier?: boolean;
|
|
7
|
+
tailwindcss?: boolean;
|
|
7
8
|
};
|
|
8
9
|
type UserConfigItem = Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.FlatConfig[]>;
|
|
10
|
+
|
|
9
11
|
declare function icebreaker(options?: UserDefinedOptions, ...userConfigs: UserConfigItem[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
10
12
|
|
|
11
13
|
export { type UserConfigItem, type UserDefinedOptions, icebreaker };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { Linter } from 'eslint';
|
|
2
1
|
import { OptionsConfig, TypedFlatConfigItem, Awaitable, ConfigNames } from '@antfu/eslint-config';
|
|
3
2
|
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
3
|
+
import { Linter } from 'eslint';
|
|
4
4
|
|
|
5
5
|
type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem & {
|
|
6
6
|
prettier?: boolean;
|
|
7
|
+
tailwindcss?: boolean;
|
|
7
8
|
};
|
|
8
9
|
type UserConfigItem = Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.FlatConfig[]>;
|
|
10
|
+
|
|
9
11
|
declare function icebreaker(options?: UserDefinedOptions, ...userConfigs: UserConfigItem[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
10
12
|
|
|
11
13
|
export { type UserConfigItem, type UserDefinedOptions, icebreaker };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
2
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
3
|
+
import { isPackageExists } from 'local-pkg';
|
|
2
4
|
import { antfu } from '@antfu/eslint-config';
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
const compat = new FlatCompat();
|
|
7
|
+
function icebreaker(options = {}, ...userConfigs) {
|
|
8
|
+
const { prettier, tailwindcss: enableTailwindcss = isPackageExists("tailwindcss"), ...opts } = options;
|
|
5
9
|
const presets = [
|
|
6
10
|
{
|
|
7
11
|
rules: {
|
|
@@ -15,7 +19,12 @@ function icebreaker(options, ...userConfigs) {
|
|
|
15
19
|
if (options?.prettier) {
|
|
16
20
|
presets.push(eslintPluginPrettierRecommended);
|
|
17
21
|
}
|
|
18
|
-
|
|
22
|
+
if (enableTailwindcss) {
|
|
23
|
+
presets.push(...compat.config({
|
|
24
|
+
extends: ["plugin:tailwindcss/recommended"]
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
return antfu(opts, ...presets, ...userConfigs);
|
|
19
28
|
}
|
|
20
29
|
|
|
21
30
|
export { icebreaker };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "icebreakers's eslint config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint-config",
|
|
@@ -37,9 +37,15 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@antfu/eslint-config": "2.
|
|
40
|
+
"@antfu/eslint-config": "2.18.0",
|
|
41
|
+
"@eslint/eslintrc": "^3.0.2",
|
|
41
42
|
"eslint-config-prettier": "^9.1.0",
|
|
42
|
-
"eslint-plugin-prettier": "^5.1.3"
|
|
43
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
44
|
+
"eslint-plugin-tailwindcss": "^3.15.1",
|
|
45
|
+
"local-pkg": "^0.5.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"eslint": "^9.2.0"
|
|
43
49
|
},
|
|
44
50
|
"scripts": {
|
|
45
51
|
"dev": "unbuild --sourcemap",
|