@wondermarin/eslint-config 1.0.3 → 2.0.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 CHANGED
@@ -1,21 +1,60 @@
1
1
  # @wondermarin/eslint-config
2
- <span>Personal <a href="https://eslint.org">ESLint</a> config.</span>
2
+ Personal <a href="https://eslint.org">ESLint</a> config.
3
3
 
4
- ## Install
4
+ > [!IMPORTANT]
5
+ > This package is strictly for personal use. If anyone wants to use it in their projects, please pay attention to the specific <a href="#versioning-policy">versioning policy</a>.
5
6
 
7
+ ## Installation
6
8
  ```sh
7
- yarn add -D @wondermarin/eslint-config
9
+ pnpm add -D @wondermarin/eslint-config
8
10
  ```
9
11
 
10
12
  ## Usage
13
+ `eslint.config.js`
14
+ ```js
15
+ import wondermarin from "@wondermarin/eslint-config";
11
16
 
12
- `.eslintrc`:
13
- ```jsonc
14
- {
15
- "extends": [
16
- "@wondermarin/eslint-config", // Base config.
17
- "@wondermarin/eslint-config/typescript", // TypeScript config.
18
- "@wondermarin/eslint-config/react" // React & React Hooks config.
19
- ]
20
- }
17
+ export default wondermarin({
18
+ /**
19
+ * ESLint config.
20
+ * @default true
21
+ */
22
+ javascript: true,
23
+
24
+ /**
25
+ * `@typescript-eslint/eslint-plugin` config.
26
+ * @default false
27
+ */
28
+ typescript: false,
29
+
30
+ /**
31
+ * `eslint-plugin-prettier`, `@stylistic/eslint-plugin`, and `eslint-plugin-perfectionist` config.
32
+ * @default true
33
+ */
34
+ stylistic: true,
35
+
36
+ /**
37
+ * `eslint-plugin-package-json` config.
38
+ * @default true
39
+ */
40
+ json: true,
41
+
42
+ /**
43
+ * `eslint-plugin-react` and `eslint-plugin-react-hooks` config.
44
+ * @default false
45
+ */
46
+ react: false,
47
+ });
21
48
  ```
49
+
50
+ ## Versioning Policy
51
+ The package follows <a href="https://semver.org">semantic versioning</a> with some specific nuances:
52
+ * **Patch release**: A rule is disabled.
53
+ * **Minor release**:
54
+ * A new configuration is added.
55
+ * A new rule is added (or a previously disabled rule is enabled).
56
+ * A rule is updated (updating its options or changing its severity).
57
+ * **Major release**: Major release in ESLint.
58
+
59
+ ## License
60
+ Code released under the <a href="https://github.com/Wondermarin/eslint-config/tree/main/LICENSE">MIT</a> license.
package/dist/main.d.ts ADDED
@@ -0,0 +1,36 @@
1
+ import { Linter } from 'eslint';
2
+
3
+ interface IConfig extends Omit<Linter.Config, "plugins"> {
4
+ readonly plugins?: Record<string, unknown>;
5
+ }
6
+
7
+ interface IWondermarinOptions {
8
+ /**
9
+ * [ESLint](https://github.com/eslint/eslint) config.
10
+ * @default true
11
+ */
12
+ readonly javascript?: boolean;
13
+ /**
14
+ * [`@typescript-eslint/eslint-plugin`](https://github.com/typescript-eslint/typescript-eslint) config.
15
+ * @default false
16
+ */
17
+ readonly typescript?: boolean;
18
+ /**
19
+ * [`eslint-plugin-prettier`](https://github.com/prettier/eslint-plugin-prettier), [`@stylistic/eslint-plugin`](https://github.com/eslint-stylistic/eslint-stylistic), and [`eslint-plugin-perfectionist`](https://github.com/azat-io/eslint-plugin-perfectionist) config.
20
+ * @default true
21
+ */
22
+ readonly stylistic?: boolean;
23
+ /**
24
+ * [`eslint-plugin-package-json`](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json) config.
25
+ * @default true
26
+ */
27
+ readonly json?: boolean;
28
+ /**
29
+ * [`eslint-plugin-react`](https://github.com/jsx-eslint/eslint-plugin-react) and [`eslint-plugin-react-hooks`](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks) config.
30
+ * @default false
31
+ */
32
+ readonly react?: boolean;
33
+ }
34
+ declare function wondermarin(options?: IWondermarinOptions): Promise<IConfig[]>;
35
+
36
+ export { wondermarin as default };