@icebreakers/eslint-config 0.0.2 → 0.1.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 +34 -0
- package/dist/antfu.cjs +9 -0
- package/dist/antfu.d.cts +1 -0
- package/dist/antfu.d.mts +1 -0
- package/dist/antfu.d.ts +1 -0
- package/dist/antfu.mjs +1 -0
- package/dist/index.cjs +18 -11
- package/dist/index.d.cts +6 -7
- package/dist/index.d.mts +6 -7
- package/dist/index.d.ts +6 -7
- package/dist/index.mjs +15 -11
- package/package.json +23 -6
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# @icebreakers/eslint-config
|
|
2
|
+
|
|
3
|
+
> extend [@antfu/eslint-config](https://www.npmjs.com/package/@antfu/eslint-config) and add `prettier` support!
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm i -D eslint @icebreakers/eslint-config
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
// eslint.config.mjs
|
|
13
|
+
import { icebreaker } from '@icebreakers/eslint-config'
|
|
14
|
+
|
|
15
|
+
export default icebreaker()
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
or use with `prettier`:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
// eslint.config.mjs
|
|
22
|
+
import { icebreaker } from '@icebreakers/eslint-config'
|
|
23
|
+
|
|
24
|
+
export default icebreaker({
|
|
25
|
+
prettier: true,
|
|
26
|
+
stylistic: false,
|
|
27
|
+
})
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## VS Code support
|
|
31
|
+
|
|
32
|
+
Install [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
|
|
33
|
+
|
|
34
|
+
Version: `^3.0.5` ( >=`3.0.5`)
|
package/dist/antfu.cjs
ADDED
package/dist/antfu.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@antfu/eslint-config';
|
package/dist/antfu.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@antfu/eslint-config';
|
package/dist/antfu.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@antfu/eslint-config';
|
package/dist/antfu.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@antfu/eslint-config';
|
package/dist/index.cjs
CHANGED
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const eslintConfig
|
|
3
|
+
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
|
|
4
|
+
const eslintConfig = require('@antfu/eslint-config');
|
|
5
5
|
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
7
|
+
|
|
8
|
+
const eslintPluginPrettierRecommended__default = /*#__PURE__*/_interopDefaultCompat(eslintPluginPrettierRecommended);
|
|
9
9
|
|
|
10
10
|
function icebreaker(options, ...userConfigs) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const presets = [
|
|
12
|
+
{
|
|
13
|
+
rules: {
|
|
14
|
+
"curly": ["error", "all"],
|
|
15
|
+
"no-console": ["warn"],
|
|
16
|
+
"ts/prefer-ts-expect-error": "off",
|
|
17
|
+
"ts/ban-ts-comment": "off"
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
|
-
|
|
20
|
+
];
|
|
21
|
+
if (options?.prettier) {
|
|
22
|
+
presets.push(eslintPluginPrettierRecommended__default);
|
|
23
|
+
}
|
|
24
|
+
return eslintConfig.antfu(options, ...presets, ...userConfigs);
|
|
17
25
|
}
|
|
18
26
|
|
|
19
27
|
exports.icebreaker = icebreaker;
|
|
20
|
-
exports.icebreakerWithPrettier = icebreakerWithPrettier;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { sxzz } from '@sxzz/eslint-config';
|
|
2
|
-
import { FlatESLintConfigItem } from 'eslint-define-config';
|
|
3
1
|
import { Linter } from 'eslint';
|
|
4
2
|
import { OptionsConfig, TypedFlatConfigItem, Awaitable, ConfigNames } from '@antfu/eslint-config';
|
|
5
3
|
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
6
4
|
|
|
7
|
-
type
|
|
8
|
-
|
|
5
|
+
type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem & {
|
|
6
|
+
prettier?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type UserConfigItem = Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.FlatConfig[]>;
|
|
9
|
+
declare function icebreaker(options?: UserDefinedOptions, ...userConfigs: UserConfigItem[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export { icebreaker, icebreakerWithPrettier };
|
|
11
|
+
export { type UserConfigItem, type UserDefinedOptions, icebreaker };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { sxzz } from '@sxzz/eslint-config';
|
|
2
|
-
import { FlatESLintConfigItem } from 'eslint-define-config';
|
|
3
1
|
import { Linter } from 'eslint';
|
|
4
2
|
import { OptionsConfig, TypedFlatConfigItem, Awaitable, ConfigNames } from '@antfu/eslint-config';
|
|
5
3
|
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
6
4
|
|
|
7
|
-
type
|
|
8
|
-
|
|
5
|
+
type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem & {
|
|
6
|
+
prettier?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type UserConfigItem = Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.FlatConfig[]>;
|
|
9
|
+
declare function icebreaker(options?: UserDefinedOptions, ...userConfigs: UserConfigItem[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export { icebreaker, icebreakerWithPrettier };
|
|
11
|
+
export { type UserConfigItem, type UserDefinedOptions, icebreaker };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { sxzz } from '@sxzz/eslint-config';
|
|
2
|
-
import { FlatESLintConfigItem } from 'eslint-define-config';
|
|
3
1
|
import { Linter } from 'eslint';
|
|
4
2
|
import { OptionsConfig, TypedFlatConfigItem, Awaitable, ConfigNames } from '@antfu/eslint-config';
|
|
5
3
|
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
6
4
|
|
|
7
|
-
type
|
|
8
|
-
|
|
5
|
+
type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem & {
|
|
6
|
+
prettier?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type UserConfigItem = Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.FlatConfig[]>;
|
|
9
|
+
declare function icebreaker(options?: UserDefinedOptions, ...userConfigs: UserConfigItem[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export { icebreaker, icebreakerWithPrettier };
|
|
11
|
+
export { type UserConfigItem, type UserDefinedOptions, icebreaker };
|
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
2
2
|
import { antfu } from '@antfu/eslint-config';
|
|
3
3
|
|
|
4
|
-
function icebreakerWithPrettier(config, rules) {
|
|
5
|
-
return sxzz(rules, config);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
4
|
function icebreaker(options, ...userConfigs) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
const presets = [
|
|
6
|
+
{
|
|
7
|
+
rules: {
|
|
8
|
+
"curly": ["error", "all"],
|
|
9
|
+
"no-console": ["warn"],
|
|
10
|
+
"ts/prefer-ts-expect-error": "off",
|
|
11
|
+
"ts/ban-ts-comment": "off"
|
|
12
|
+
}
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
];
|
|
15
|
+
if (options?.prettier) {
|
|
16
|
+
presets.push(eslintPluginPrettierRecommended);
|
|
17
|
+
}
|
|
18
|
+
return antfu(options, ...presets, ...userConfigs);
|
|
15
19
|
}
|
|
16
20
|
|
|
17
|
-
export { icebreaker
|
|
21
|
+
export { icebreaker };
|
package/package.json
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/eslint-config",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "icebreakers's eslint config",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"eslint-config",
|
|
7
|
+
"prettier"
|
|
8
|
+
],
|
|
6
9
|
"author": "",
|
|
7
|
-
"license": "
|
|
10
|
+
"license": "MIT",
|
|
8
11
|
"type": "module",
|
|
9
12
|
"exports": {
|
|
10
13
|
".": {
|
|
11
14
|
"types": "./dist/index.d.ts",
|
|
12
15
|
"import": "./dist/index.mjs",
|
|
13
16
|
"require": "./dist/index.cjs"
|
|
14
|
-
}
|
|
17
|
+
},
|
|
18
|
+
"./antfu": {
|
|
19
|
+
"types": "./dist/antfu.d.ts",
|
|
20
|
+
"import": "./dist/antfu.mjs",
|
|
21
|
+
"require": "./dist/antfu.cjs"
|
|
22
|
+
},
|
|
23
|
+
"./*": "./*"
|
|
15
24
|
},
|
|
16
25
|
"main": "./dist/index.cjs",
|
|
17
26
|
"module": "./dist/index.mjs",
|
|
@@ -19,11 +28,19 @@
|
|
|
19
28
|
"files": [
|
|
20
29
|
"dist"
|
|
21
30
|
],
|
|
31
|
+
"typesVersions": {
|
|
32
|
+
"*": {
|
|
33
|
+
"*": [
|
|
34
|
+
"./dist/*",
|
|
35
|
+
"./dist/index.d.ts"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
22
39
|
"dependencies": {
|
|
23
40
|
"@antfu/eslint-config": "2.17.0",
|
|
24
|
-
"
|
|
41
|
+
"eslint-config-prettier": "^9.1.0",
|
|
42
|
+
"eslint-plugin-prettier": "^5.1.3"
|
|
25
43
|
},
|
|
26
|
-
"devDependencies": {},
|
|
27
44
|
"scripts": {
|
|
28
45
|
"dev": "unbuild --sourcemap",
|
|
29
46
|
"build": "unbuild",
|