@icebreakers/eslint-config 0.3.0 → 0.3.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/dist/index.cjs +22 -34
- package/dist/index.mjs +23 -22
- package/package.json +11 -7
package/dist/index.cjs
CHANGED
|
@@ -3,25 +3,11 @@
|
|
|
3
3
|
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
|
|
4
4
|
const eslintrc = require('@eslint/eslintrc');
|
|
5
5
|
const localPkg = require('local-pkg');
|
|
6
|
-
const mdx = require('eslint-plugin-mdx');
|
|
7
6
|
const eslintConfig = require('@antfu/eslint-config');
|
|
8
7
|
|
|
9
8
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
10
9
|
|
|
11
|
-
function _interopNamespaceCompat(e) {
|
|
12
|
-
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
13
|
-
const n = Object.create(null);
|
|
14
|
-
if (e) {
|
|
15
|
-
for (const k in e) {
|
|
16
|
-
n[k] = e[k];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
n.default = e;
|
|
20
|
-
return n;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
10
|
const eslintPluginPrettierRecommended__default = /*#__PURE__*/_interopDefaultCompat(eslintPluginPrettierRecommended);
|
|
24
|
-
const mdx__namespace = /*#__PURE__*/_interopNamespaceCompat(mdx);
|
|
25
11
|
|
|
26
12
|
const compat = new eslintrc.FlatCompat();
|
|
27
13
|
function icebreaker(options = {}, ...userConfigs) {
|
|
@@ -50,27 +36,29 @@ function icebreaker(options = {}, ...userConfigs) {
|
|
|
50
36
|
}));
|
|
51
37
|
}
|
|
52
38
|
if (enableMDX) {
|
|
53
|
-
presets.push({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
39
|
+
presets.push(eslintConfig.interopDefault(import('eslint-plugin-mdx')).then((mdx) => {
|
|
40
|
+
return [
|
|
41
|
+
{
|
|
42
|
+
...mdx.flat,
|
|
43
|
+
// optional, if you want to lint code blocks at the same
|
|
44
|
+
processor: mdx.createRemarkProcessor({
|
|
45
|
+
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
|
+
languageMapper: {}
|
|
49
|
+
})
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
...mdx.flatCodeBlocks,
|
|
53
|
+
rules: {
|
|
54
|
+
...mdx.flatCodeBlocks.rules
|
|
55
|
+
// if you want to override some rules for code blocks
|
|
56
|
+
// 'no-var': 'error',
|
|
57
|
+
// 'prefer-const': 'error',
|
|
58
|
+
}
|
|
71
59
|
}
|
|
72
|
-
|
|
73
|
-
);
|
|
60
|
+
];
|
|
61
|
+
}));
|
|
74
62
|
}
|
|
75
63
|
return eslintConfig.antfu(opts, ...presets, ...userConfigs);
|
|
76
64
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
2
2
|
import { FlatCompat } from '@eslint/eslintrc';
|
|
3
3
|
import { isPackageExists } from 'local-pkg';
|
|
4
|
-
import
|
|
5
|
-
import { antfu } from '@antfu/eslint-config';
|
|
4
|
+
import { interopDefault, antfu } from '@antfu/eslint-config';
|
|
6
5
|
|
|
7
6
|
const compat = new FlatCompat();
|
|
8
7
|
function icebreaker(options = {}, ...userConfigs) {
|
|
@@ -31,27 +30,29 @@ function icebreaker(options = {}, ...userConfigs) {
|
|
|
31
30
|
}));
|
|
32
31
|
}
|
|
33
32
|
if (enableMDX) {
|
|
34
|
-
presets.push({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
33
|
+
presets.push(interopDefault(import('eslint-plugin-mdx')).then((mdx) => {
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
...mdx.flat,
|
|
37
|
+
// optional, if you want to lint code blocks at the same
|
|
38
|
+
processor: mdx.createRemarkProcessor({
|
|
39
|
+
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
|
+
languageMapper: {}
|
|
43
|
+
})
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
...mdx.flatCodeBlocks,
|
|
47
|
+
rules: {
|
|
48
|
+
...mdx.flatCodeBlocks.rules
|
|
49
|
+
// if you want to override some rules for code blocks
|
|
50
|
+
// 'no-var': 'error',
|
|
51
|
+
// 'prefer-const': 'error',
|
|
52
|
+
}
|
|
52
53
|
}
|
|
53
|
-
|
|
54
|
-
);
|
|
54
|
+
];
|
|
55
|
+
}));
|
|
55
56
|
}
|
|
56
57
|
return antfu(opts, ...presets, ...userConfigs);
|
|
57
58
|
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/eslint-config",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.3.1",
|
|
4
5
|
"description": "icebreakers's eslint config",
|
|
6
|
+
"author": "",
|
|
7
|
+
"license": "MIT",
|
|
5
8
|
"keywords": [
|
|
6
9
|
"eslint-config",
|
|
7
10
|
"prettier",
|
|
8
11
|
"icebreaker"
|
|
9
12
|
],
|
|
10
|
-
"author": "",
|
|
11
|
-
"license": "MIT",
|
|
12
|
-
"type": "module",
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
@@ -21,9 +21,6 @@
|
|
|
21
21
|
"main": "./dist/index.cjs",
|
|
22
22
|
"module": "./dist/index.mjs",
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
24
|
-
"files": [
|
|
25
|
-
"dist"
|
|
26
|
-
],
|
|
27
24
|
"typesVersions": {
|
|
28
25
|
"*": {
|
|
29
26
|
"*": [
|
|
@@ -32,6 +29,9 @@
|
|
|
32
29
|
]
|
|
33
30
|
}
|
|
34
31
|
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist"
|
|
34
|
+
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@antfu/eslint-config": "2.18.1",
|
|
37
37
|
"@eslint/eslintrc": "^3.1.0",
|
|
@@ -41,6 +41,10 @@
|
|
|
41
41
|
"eslint-plugin-tailwindcss": "^3.15.2",
|
|
42
42
|
"local-pkg": "^0.5.0"
|
|
43
43
|
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public",
|
|
46
|
+
"registry": "https://registry.npmjs.org"
|
|
47
|
+
},
|
|
44
48
|
"scripts": {
|
|
45
49
|
"dev": "unbuild --sourcemap",
|
|
46
50
|
"build": "unbuild",
|