@mareuter/eslint-config 0.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # @mareuter/eslint-config
2
+
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix publishing
8
+
9
+ ## 0.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - Initial release
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Michael Reuter
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do
10
+ so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice (including the next
13
+ paragraph) shall be included in all copies or substantial portions of the
14
+ Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # `@mareuter/eslint-config`
2
+
3
+ ESLint configuration for libraries and projects.
4
+
5
+ ## Install
6
+
7
+ ```
8
+ pnpm add -DE @mareuter/eslint-config
9
+ ```
10
+
11
+ **Note**: To use this package you must install the peer dependencies. There are multiple configurations in this package.
12
+
13
+ For the ``base`` configuration:
14
+ ```
15
+ pnpm add -DE eslint typescript-eslint eslint-config-prettier eslint-plugin-prettier eslint-plugin-only-warn @eslint/js
16
+ ```
17
+
18
+ For the ``turbo`` configuration, install the ``base`` packages and then:
19
+ ```
20
+ pnpm add -DE eslint-plugin-turbo
21
+ ```
22
+
23
+ For the ``react`` configuration, install the ``base`` packages and then:
24
+ ```
25
+ pnpm add -DE eslint-plugin-react eslint-plugin-react-hooks globals
package/base.js ADDED
@@ -0,0 +1,36 @@
1
+ import js from '@eslint/js'
2
+ import eslintConfigPrettier from 'eslint-config-prettier'
3
+ import tseslint from 'typescript-eslint'
4
+ import onlyWarn from 'eslint-plugin-only-warn'
5
+
6
+ /**
7
+ * A shared ESLint configuration for the repository.
8
+ *
9
+ * @type {import("eslint").Linter.Config}
10
+ * */
11
+ export const config = [
12
+ js.configs.recommended,
13
+ eslintConfigPrettier,
14
+ ...tseslint.configs.recommended,
15
+ {
16
+ plugins: {
17
+ onlyWarn,
18
+ },
19
+ },
20
+ {
21
+ rules: {
22
+ // Allow unused variables if they are prefixed with _
23
+ '@typescript-eslint/no-unused-vars': [
24
+ 'error',
25
+ {
26
+ argsIgnorePattern: '^_',
27
+ varsIgnorePattern: '^_',
28
+ caughtErrorsIgnorePattern: '^_',
29
+ },
30
+ ],
31
+ },
32
+ },
33
+ {
34
+ ignores: ['node_modules/**', 'dist/**'],
35
+ },
36
+ ]
@@ -0,0 +1,3 @@
1
+ declare module '@mareuter/eslint-config/base'
2
+ declare module '@mareuter/eslint-config/react'
3
+ declare module '@mareuter/eslint-config/turbo'
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@mareuter/eslint-config",
3
+ "version": "0.1.1",
4
+ "type": "module",
5
+ "exports": {
6
+ "./base": "./base.js",
7
+ "./react": "./react.js",
8
+ "./turbo": "./turbo.js"
9
+ },
10
+ "description": "ESLint configuration for projects",
11
+ "license": "MIT",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/mareuter/npm-shared.git"
15
+ },
16
+ "homepage": "https://github.com/mareuter/npm-shared/eslint-config#readme",
17
+ "keywords": [
18
+ "eslint",
19
+ "eslintconfig"
20
+ ],
21
+ "author": {
22
+ "name": "Michael Reuter"
23
+ },
24
+ "lint-staged": {
25
+ "*.{json,md}": [
26
+ "prettier --write"
27
+ ],
28
+ "*.{js,ts}": [
29
+ "eslint --fix",
30
+ "prettier --write"
31
+ ]
32
+ },
33
+ "devDependencies": {
34
+ "@eslint/js": "^10.0.1",
35
+ "eslint": "^10.2.1"
36
+ },
37
+ "peerDependencies": {
38
+ "@eslint/js": "^10.0.1",
39
+ "eslint": "^10.2.1",
40
+ "eslint-config-prettier": "^10.1.8",
41
+ "eslint-plugin-only-warn": "^1.2.1",
42
+ "eslint-plugin-prettier": "^5.5.5",
43
+ "eslint-plugin-react": "^7.37.5",
44
+ "eslint-plugin-react-hooks": "^7.1.1",
45
+ "globals": "^17.5.0",
46
+ "typescript-eslint": "^8.59.0"
47
+ },
48
+ "scripts": {
49
+ "publish:npm": "npm publish --registry https://registry.npmjs.org/ --access public --ignore-scripts",
50
+ "dry-run:npm": "npm publish --dry-run"
51
+ }
52
+ }
package/react.js ADDED
@@ -0,0 +1,33 @@
1
+ import pluginReact from "eslint-plugin-react"
2
+ import pluginReactHooks from "eslint-plugin-react-hooks"
3
+ import globals from "globals"
4
+ import { config as baseConfig } from "./base"
5
+
6
+ /**
7
+ * A custom ESLint configuration for libraries that use React.
8
+ *
9
+ * @type {import("eslint").Linter.Config[]} */
10
+ export const config = [
11
+ ...baseConfig,
12
+ pluginReact.configs.flat.recommended,
13
+ {
14
+ languageOptions: {
15
+ ...pluginReact.configs.flat.recommended.languageOptions,
16
+ globals: {
17
+ ...globals.serviceworker,
18
+ ...globals.browser,
19
+ },
20
+ },
21
+ },
22
+ {
23
+ plugins: {
24
+ "react-hooks": pluginReactHooks,
25
+ },
26
+ settings: { react: { version: "detect" } },
27
+ rules: {
28
+ ...pluginReactHooks.configs.recommended.rules,
29
+ // React scope no longer necessary with new JSX transform.
30
+ "react/react-in-jsx-scope": "off",
31
+ },
32
+ },
33
+ ]
package/turbo.js ADDED
@@ -0,0 +1,18 @@
1
+ import turboPlugin from 'eslint-plugin-turbo'
2
+ import { base as baseConfig } from './base'
3
+
4
+ /**
5
+ * A custom ESLint configuration for libraries/projects that use Turbo.
6
+ *
7
+ * @type {import("eslint").Linter.Config[]} */
8
+ export const config = [
9
+ ...baseConfig,
10
+ {
11
+ plugins: {
12
+ turbo: turboPlugin,
13
+ },
14
+ rules: {
15
+ 'turbo/no-undeclared-env-vars': 'warn',
16
+ },
17
+ },
18
+ ]