@icebreakers/eslint-config 0.3.1 → 0.3.3
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 +3 -11
- package/dist/index.mjs +2 -11
- package/package.json +3 -4
package/dist/index.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
|
|
4
|
-
const eslintrc = require('@eslint/eslintrc');
|
|
5
4
|
const localPkg = require('local-pkg');
|
|
5
|
+
const tailwind = require('eslint-plugin-tailwindcss');
|
|
6
6
|
const eslintConfig = require('@antfu/eslint-config');
|
|
7
7
|
|
|
8
8
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
9
9
|
|
|
10
10
|
const eslintPluginPrettierRecommended__default = /*#__PURE__*/_interopDefaultCompat(eslintPluginPrettierRecommended);
|
|
11
|
+
const tailwind__default = /*#__PURE__*/_interopDefaultCompat(tailwind);
|
|
11
12
|
|
|
12
|
-
const compat = new eslintrc.FlatCompat();
|
|
13
13
|
function icebreaker(options = {}, ...userConfigs) {
|
|
14
14
|
const {
|
|
15
15
|
prettier: enablePrettier,
|
|
@@ -31,20 +31,15 @@ function icebreaker(options = {}, ...userConfigs) {
|
|
|
31
31
|
presets.push(eslintPluginPrettierRecommended__default);
|
|
32
32
|
}
|
|
33
33
|
if (enableTailwindcss) {
|
|
34
|
-
presets.push(...
|
|
35
|
-
extends: ["plugin:tailwindcss/recommended"]
|
|
36
|
-
}));
|
|
34
|
+
presets.push(...tailwind__default.configs["flat/recommended"]);
|
|
37
35
|
}
|
|
38
36
|
if (enableMDX) {
|
|
39
37
|
presets.push(eslintConfig.interopDefault(import('eslint-plugin-mdx')).then((mdx) => {
|
|
40
38
|
return [
|
|
41
39
|
{
|
|
42
40
|
...mdx.flat,
|
|
43
|
-
// optional, if you want to lint code blocks at the same
|
|
44
41
|
processor: mdx.createRemarkProcessor({
|
|
45
42
|
lintCodeBlocks: true,
|
|
46
|
-
// optional, if you want to disable language mapper, set it to `false`
|
|
47
|
-
// if you want to override the default language mapper inside, you can provide your own
|
|
48
43
|
languageMapper: {}
|
|
49
44
|
})
|
|
50
45
|
},
|
|
@@ -52,9 +47,6 @@ function icebreaker(options = {}, ...userConfigs) {
|
|
|
52
47
|
...mdx.flatCodeBlocks,
|
|
53
48
|
rules: {
|
|
54
49
|
...mdx.flatCodeBlocks.rules
|
|
55
|
-
// if you want to override some rules for code blocks
|
|
56
|
-
// 'no-var': 'error',
|
|
57
|
-
// 'prefer-const': 'error',
|
|
58
50
|
}
|
|
59
51
|
}
|
|
60
52
|
];
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
2
|
-
import { FlatCompat } from '@eslint/eslintrc';
|
|
3
2
|
import { isPackageExists } from 'local-pkg';
|
|
3
|
+
import tailwind from 'eslint-plugin-tailwindcss';
|
|
4
4
|
import { interopDefault, antfu } from '@antfu/eslint-config';
|
|
5
5
|
|
|
6
|
-
const compat = new FlatCompat();
|
|
7
6
|
function icebreaker(options = {}, ...userConfigs) {
|
|
8
7
|
const {
|
|
9
8
|
prettier: enablePrettier,
|
|
@@ -25,20 +24,15 @@ function icebreaker(options = {}, ...userConfigs) {
|
|
|
25
24
|
presets.push(eslintPluginPrettierRecommended);
|
|
26
25
|
}
|
|
27
26
|
if (enableTailwindcss) {
|
|
28
|
-
presets.push(...
|
|
29
|
-
extends: ["plugin:tailwindcss/recommended"]
|
|
30
|
-
}));
|
|
27
|
+
presets.push(...tailwind.configs["flat/recommended"]);
|
|
31
28
|
}
|
|
32
29
|
if (enableMDX) {
|
|
33
30
|
presets.push(interopDefault(import('eslint-plugin-mdx')).then((mdx) => {
|
|
34
31
|
return [
|
|
35
32
|
{
|
|
36
33
|
...mdx.flat,
|
|
37
|
-
// optional, if you want to lint code blocks at the same
|
|
38
34
|
processor: mdx.createRemarkProcessor({
|
|
39
35
|
lintCodeBlocks: true,
|
|
40
|
-
// optional, if you want to disable language mapper, set it to `false`
|
|
41
|
-
// if you want to override the default language mapper inside, you can provide your own
|
|
42
36
|
languageMapper: {}
|
|
43
37
|
})
|
|
44
38
|
},
|
|
@@ -46,9 +40,6 @@ function icebreaker(options = {}, ...userConfigs) {
|
|
|
46
40
|
...mdx.flatCodeBlocks,
|
|
47
41
|
rules: {
|
|
48
42
|
...mdx.flatCodeBlocks.rules
|
|
49
|
-
// if you want to override some rules for code blocks
|
|
50
|
-
// 'no-var': 'error',
|
|
51
|
-
// 'prefer-const': 'error',
|
|
52
43
|
}
|
|
53
44
|
}
|
|
54
45
|
];
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.3",
|
|
5
5
|
"description": "icebreakers's eslint config",
|
|
6
|
-
"author": "",
|
|
6
|
+
"author": "SonOfMagic <qq1324318532@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"eslint-config",
|
|
@@ -34,11 +34,10 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@antfu/eslint-config": "2.18.1",
|
|
37
|
-
"@eslint/eslintrc": "^3.1.0",
|
|
38
37
|
"eslint-config-prettier": "^9.1.0",
|
|
39
38
|
"eslint-plugin-mdx": "^3.1.5",
|
|
40
39
|
"eslint-plugin-prettier": "^5.1.3",
|
|
41
|
-
"eslint-plugin-tailwindcss": "^3.
|
|
40
|
+
"eslint-plugin-tailwindcss": "^3.16.0",
|
|
42
41
|
"local-pkg": "^0.5.0"
|
|
43
42
|
},
|
|
44
43
|
"publishConfig": {
|