@becklyn/eslint 0.1.1 → 1.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @becklyn/eslint@0.1.1 test
2
+ > @becklyn/eslint@1.0.0 test
3
3
  > echo "Error: no test specified" && exit 0
4
4
 
5
5
  Error: no test specified
package/CHANGELOG.md CHANGED
@@ -1,13 +1,19 @@
1
1
  # @becklyn/eslint
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - a808fc6: Update to eslint 9
8
+
3
9
  ## 0.1.1
4
10
 
5
11
  ### Patch Changes
6
12
 
7
- - c012500: Re release
13
+ - c012500: Re release
8
14
 
9
15
  ## 0.1.0
10
16
 
11
17
  ### Minor Changes
12
18
 
13
- - ad54cbf: Initial release
19
+ - ad54cbf: Initial release
package/README.md CHANGED
@@ -1,27 +1,39 @@
1
- # eslint-config
1
+ # eslint
2
2
 
3
- The eslint-config base we use for our TypeScript apps.
3
+ The eslint base config we use for our TypeScript apps.
4
4
 
5
5
  ## Usage
6
6
 
7
- Use in your `.eslintrc.js`:
7
+ ### NextJs Projects
8
+
9
+ Use in your `eslint.config.js`:
10
+
11
+ ```js
12
+ import { nextJsConfig } from "@becklyn/eslint/next-js";
13
+
14
+ /** @type {import("eslint").Linter.Config} */
15
+ export default nextJsConfig;
16
+ ```
17
+
18
+
19
+ ### React Projects
20
+
21
+ Use in your `eslint.config.mjs`:
8
22
 
9
23
  ```js
24
+ import { config } from "@becklyn/eslint/react-internal";
25
+
26
+ /** @type {import("eslint").Linter.Config} */
27
+ export default config;
28
+ ```
29
+
30
+ ### JS Projects
31
+
32
+ Use in your `eslint.config.mjs`:
33
+
34
+ ```js
35
+ import { config } from "@becklyn/eslint/base";
36
+
10
37
  /** @type {import("eslint").Linter.Config} */
11
- module.exports = {
12
- extends: [
13
- "@becklyn/eslint-config/eslint.js",
14
- "plugin:@dword-design/import-alias/recommended",
15
- ],
16
- rules: {
17
- "@dword-design/import-alias/prefer-alias": [
18
- "error",
19
- {
20
- alias: {
21
- "@": ".",
22
- },
23
- },
24
- ],
25
- },
26
- };
38
+ export default config;
27
39
  ```
package/base.js ADDED
@@ -0,0 +1,41 @@
1
+ import js from "@eslint/js";
2
+ import eslintConfigPrettier from "eslint-config-prettier";
3
+ import turboPlugin from "eslint-plugin-turbo";
4
+ import tseslint from "typescript-eslint";
5
+ import onlyWarn from "eslint-plugin-only-warn";
6
+ import importAlias from "@limegrass/import-alias";
7
+
8
+ /**
9
+ * A shared ESLint configuration for the repository.
10
+ *
11
+ * @type {import("eslint").Linter.Config}
12
+ * */
13
+ export const config = [
14
+ js.configs.recommended,
15
+ eslintConfigPrettier,
16
+ ...tseslint.configs.recommended,
17
+ {
18
+ plugins: {
19
+ "@limegrass/import-alias": importAlias,
20
+ },
21
+ rules: {
22
+ "@limegrass/import-alias/import-alias": "error",
23
+ },
24
+ },
25
+ {
26
+ plugins: {
27
+ turbo: turboPlugin,
28
+ },
29
+ rules: {
30
+ "turbo/no-undeclared-env-vars": "warn",
31
+ },
32
+ },
33
+ {
34
+ plugins: {
35
+ onlyWarn,
36
+ },
37
+ },
38
+ {
39
+ ignores: ["dist/**"],
40
+ },
41
+ ];
package/next.js ADDED
@@ -0,0 +1,49 @@
1
+ import js from "@eslint/js";
2
+ import eslintConfigPrettier from "eslint-config-prettier";
3
+ import tseslint from "typescript-eslint";
4
+ import pluginReactHooks from "eslint-plugin-react-hooks";
5
+ import pluginReact from "eslint-plugin-react";
6
+ import globals from "globals";
7
+ import pluginNext from "@next/eslint-plugin-next";
8
+ import { config as baseConfig } from "./base.js";
9
+
10
+ /**
11
+ * A custom ESLint configuration for libraries that use Next.js.
12
+ *
13
+ * @type {import("eslint").Linter.Config}
14
+ * */
15
+ export const nextJsConfig = [
16
+ ...baseConfig,
17
+ js.configs.recommended,
18
+ eslintConfigPrettier,
19
+ ...tseslint.configs.recommended,
20
+ {
21
+ ...pluginReact.configs.flat.recommended,
22
+ languageOptions: {
23
+ ...pluginReact.configs.flat.recommended.languageOptions,
24
+ globals: {
25
+ ...globals.serviceworker,
26
+ },
27
+ },
28
+ },
29
+ {
30
+ plugins: {
31
+ "@next/next": pluginNext,
32
+ },
33
+ rules: {
34
+ ...pluginNext.configs.recommended.rules,
35
+ ...pluginNext.configs["core-web-vitals"].rules,
36
+ },
37
+ },
38
+ {
39
+ plugins: {
40
+ "react-hooks": pluginReactHooks,
41
+ },
42
+ settings: { react: { version: "detect" } },
43
+ rules: {
44
+ ...pluginReactHooks.configs.recommended.rules,
45
+ // React scope no longer necessary with new JSX transform.
46
+ "react/react-in-jsx-scope": "off",
47
+ },
48
+ },
49
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@becklyn/eslint",
3
- "version": "0.1.1",
3
+ "version": "1.0.0",
4
4
  "license": "MIT",
5
5
  "description": "the eslint-config base we use for our TypeScript apps",
6
6
  "homepage": "https://github.com/Becklyn-Studios/ts-libs",
@@ -9,18 +9,27 @@
9
9
  "url": "git+https://github.com/Becklyn-Studios/ts-libs.git",
10
10
  "directory": "packages/eslint-config"
11
11
  },
12
- "files": [
13
- "**/*"
14
- ],
12
+ "type": "module",
13
+ "expo<rts": {
14
+ "./base": "./base.js",
15
+ "./next-js": "./next.js",
16
+ "./react-internal": "./react-internal.js"
17
+ },
15
18
  "scripts": {
16
19
  "test": "echo \"Error: no test specified\" && exit 0"
17
20
  },
18
21
  "dependencies": {
19
- "@dword-design/eslint-plugin-import-alias": "^5.1.1",
20
- "@next/eslint-plugin-next": "^14.1.1",
21
- "eslint": "^8.57.1",
22
- "eslint-config-next": "^14.2.17",
23
- "eslint-plugin-react": "^7.37.2",
24
- "eslint-plugin-storybook": "^0.8.0"
22
+ "@eslint/js": "^9.19.0",
23
+ "@limegrass/eslint-plugin-import-alias": "^1.5.0",
24
+ "@next/eslint-plugin-next": "^15.1.6",
25
+ "eslint": "^9.19.0",
26
+ "eslint-config-prettier": "^10.0.1",
27
+ "eslint-plugin-only-warn": "^1.1.0",
28
+ "eslint-plugin-react": "^7.37.4",
29
+ "eslint-plugin-react-hooks": "^5.1.0",
30
+ "eslint-plugin-turbo": "^2.3.4",
31
+ "globals": "^15.14.0",
32
+ "typescript": "^5.7.3",
33
+ "typescript-eslint": "^8.22.0"
25
34
  }
26
35
  }
@@ -0,0 +1,39 @@
1
+ import js from "@eslint/js";
2
+ import eslintConfigPrettier from "eslint-config-prettier";
3
+ import tseslint from "typescript-eslint";
4
+ import pluginReactHooks from "eslint-plugin-react-hooks";
5
+ import pluginReact from "eslint-plugin-react";
6
+ import globals from "globals";
7
+ import { config as baseConfig } from "./base.js";
8
+
9
+ /**
10
+ * A custom ESLint configuration for libraries that use React.
11
+ *
12
+ * @type {import("eslint").Linter.Config} */
13
+ export const config = [
14
+ ...baseConfig,
15
+ js.configs.recommended,
16
+ eslintConfigPrettier,
17
+ ...tseslint.configs.recommended,
18
+ pluginReact.configs.flat.recommended,
19
+ {
20
+ languageOptions: {
21
+ ...pluginReact.configs.flat.recommended.languageOptions,
22
+ globals: {
23
+ ...globals.serviceworker,
24
+ ...globals.browser,
25
+ },
26
+ },
27
+ },
28
+ {
29
+ plugins: {
30
+ "react-hooks": pluginReactHooks,
31
+ },
32
+ settings: { react: { version: "detect" } },
33
+ rules: {
34
+ ...pluginReactHooks.configs.recommended.rules,
35
+ // React scope no longer necessary with new JSX transform.
36
+ "react/react-in-jsx-scope": "off",
37
+ },
38
+ },
39
+ ];