@theholocron/eslint-config 3.1.0 → 3.2.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/README.md CHANGED
@@ -10,12 +10,13 @@ npm install --save-dev @theholocron/eslint-config
10
10
 
11
11
  ## Usage
12
12
 
13
- In your project `package.json` add the following:
13
+ In your project `eslint.config.js` add the following:
14
14
 
15
- ```json
16
- {
17
- "eslintConfig": {
18
- "extends": "@theholocron"
19
- },
20
- }
15
+ ```javascript
16
+ import theHolocron, {
17
+ theHolocronCypress,
18
+ theHolocronStorybook,
19
+ } from "@theholocron/eslint-config";
20
+
21
+ export default [...theHolocron, ...theHolocronStorybook, ...theHolocronCypress];
21
22
  ```
@@ -0,0 +1,7 @@
1
+ import pluginCypress from "eslint-plugin-cypress/flat";
2
+
3
+ /**
4
+ * @see https://eslint.org/docs/latest/use/configure/
5
+ * @type {import("eslint").Linter.Config}
6
+ */
7
+ export default [pluginCypress.configs.recommended];
package/eslint.config.js CHANGED
@@ -1,15 +1,31 @@
1
+ import path from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import { includeIgnoreFile } from "@eslint/compat";
1
4
  import pluginJs from "@eslint/js";
2
5
  import pluginReact from "eslint-plugin-react";
3
6
  import globals from "globals";
4
7
  import tseslint from "typescript-eslint";
5
8
 
9
+ // Get the current file path and directory (node_modules/foo/)
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = path.dirname(__filename);
12
+
13
+ // Navigate to the root directory (two levels up from node_modules/foo/)
14
+ const rootDir = path.resolve(__dirname, "../../../");
15
+
16
+ // Resolve the .gitignore file from the root directory
17
+ const gitignorePath = path.resolve(rootDir, ".gitignore");
18
+
6
19
  /**
7
20
  * @see https://eslint.org/docs/latest/use/configure/
8
21
  * @type {import("eslint").Linter.Config}
9
22
  */
10
23
  export default [
24
+ includeIgnoreFile(gitignorePath),
11
25
  {
26
+ name: "The Holocron",
12
27
  files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"],
28
+ ignores: ["**/mockServiceWorker.js"],
13
29
  },
14
30
  {
15
31
  languageOptions: {
@@ -22,4 +38,5 @@ export default [
22
38
  pluginJs.configs.recommended,
23
39
  ...tseslint.configs.recommended,
24
40
  pluginReact.configs.flat.recommended,
41
+ pluginReact.configs.flat["jsx-runtime"],
25
42
  ];
package/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import eslintConfig from "./eslint.config.js";
2
+ import theHolocronCypress from "./cypress.eslint.config.js";
3
+ import theHolocronStorybook from "./storybook.eslint.config.js";
4
+
5
+ export default eslintConfig;
6
+ export { theHolocronCypress, theHolocronStorybook };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@theholocron/eslint-config",
3
- "version": "3.1.0",
3
+ "version": "3.2.1",
4
4
  "description": "A ESLint configuration for writing well-formed Javascript within the Galaxy.",
5
- "homepage": "https://github.com/theholocron/configs/tree/main/packages/commitlint-config#readme",
5
+ "homepage": "https://github.com/theholocron/configs/tree/main/packages/eslint-config#readme",
6
6
  "bugs": "https://github.com/theholocron/configs/issues",
7
7
  "repository": {
8
8
  "type": "git",
@@ -11,13 +11,21 @@
11
11
  "license": "GPL-3.0",
12
12
  "author": "Newton Koumantzelis",
13
13
  "type": "module",
14
- "main": "eslint.config.js",
14
+ "main": "index.js",
15
+ "files": [
16
+ "cypress.eslint.config.js",
17
+ "eslint.config.js",
18
+ "storybook.eslint.config.js"
19
+ ],
15
20
  "dependencies": {
16
- "@eslint/js": "^9.12.0",
17
- "eslint": "^9.12.0",
21
+ "@eslint/compat": "^1.2.1",
22
+ "@eslint/js": "^9.13.0",
23
+ "eslint": "^9.13.0",
24
+ "eslint-plugin-cypress": "^4.0.0",
18
25
  "eslint-plugin-react": "^7.37.1",
26
+ "eslint-plugin-storybook": "^0.10.1",
19
27
  "globals": "^15.11.0",
20
- "typescript-eslint": "^8.9.0"
28
+ "typescript-eslint": "^8.11.0"
21
29
  },
22
30
  "publishConfig": {
23
31
  "access": "public"
@@ -0,0 +1,7 @@
1
+ import storybook from "eslint-plugin-storybook";
2
+
3
+ /**
4
+ * @see https://eslint.org/docs/latest/use/configure/
5
+ * @type {import("eslint").Linter.Config}
6
+ */
7
+ export default [...storybook.configs["flat/recommended"]];
package/CHANGELOG.md DELETED
@@ -1,13 +0,0 @@
1
- # @theholocron/eslint-config
2
-
3
- ## 3.1.0
4
-
5
- ### Minor Changes
6
-
7
- - [`4f8154a`](https://github.com/theholocron/configs/commit/4f8154a534d5d7668cd2659da322448f39646aed) Thanks [@iamnewton](https://github.com/iamnewton)! - Update to include Alex language linting in lint-staging
8
-
9
- ## 3.0.0
10
-
11
- ### Major Changes
12
-
13
- - [`88d7f99`](https://github.com/theholocron/configs/commit/88d7f995dd02cdbe63817ac0d13905d5aea3777a) Thanks [@iamnewton](https://github.com/iamnewton)! - Initial release