@mlaursen/eslint-config 5.0.0 → 5.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 +14 -3
- package/dist/gitignore.d.ts +2 -0
- package/dist/gitignore.js +15 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -1
- package/dist/next.d.ts +2 -0
- package/dist/next.js +28 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -14,11 +14,11 @@ Then create an `eslint.config.mjs` with the following:
|
|
|
14
14
|
|
|
15
15
|
```js
|
|
16
16
|
// @ts-check
|
|
17
|
-
import { config, configs } from "@mlaursen/eslint-config";
|
|
17
|
+
import { config, configs, gitignore } from "@mlaursen/eslint-config";
|
|
18
18
|
|
|
19
19
|
// choose the config you want to use
|
|
20
|
-
export default config(...configs.frontend);
|
|
21
|
-
export default config(...configs.frontendTypeChecking(import.meta.dirname));
|
|
20
|
+
export default config(gitignore(import.meta.url), ...configs.frontend);
|
|
21
|
+
export default config(gitignore(import.meta.url), ...configs.frontendTypeChecking(import.meta.dirname));
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
The `config` export is the `typescript-eslint.config()` function to provide
|
|
@@ -128,6 +128,17 @@ import { config, configs } from "@mlaursen/eslint-config";
|
|
|
128
128
|
export default config(...configs.testingLibraryDom);
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
+
### next
|
|
132
|
+
|
|
133
|
+
This is a small wrapper around the `@next/eslint-plugin-next` that works with eslint v9.
|
|
134
|
+
|
|
135
|
+
```js
|
|
136
|
+
// @ts-check
|
|
137
|
+
import { config, configs } from "@mlaursen/eslint-config";
|
|
138
|
+
|
|
139
|
+
export default config(...configs.next);
|
|
140
|
+
```
|
|
141
|
+
|
|
131
142
|
### frontend
|
|
132
143
|
|
|
133
144
|
This is my normal frontend repo setup with `jest`, `jest-dom`, `typescript`, `react`, `testing-library/react`.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.gitignore = gitignore;
|
|
7
|
+
var compat_1 = require("@eslint/compat");
|
|
8
|
+
var node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
var node_url_1 = require("node:url");
|
|
10
|
+
function gitignore(importMetaUrl) {
|
|
11
|
+
var __filename = (0, node_url_1.fileURLToPath)(importMetaUrl);
|
|
12
|
+
var __dirname = node_path_1.default.dirname(__filename);
|
|
13
|
+
var gitignorePath = node_path_1.default.resolve(__dirname, ".gitignore");
|
|
14
|
+
return (0, compat_1.includeIgnoreFile)(gitignorePath);
|
|
15
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { config } from "typescript-eslint";
|
|
2
|
+
export { gitignore } from "./gitignore";
|
|
2
3
|
export declare const configs: {
|
|
3
4
|
readonly base: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
|
|
4
5
|
readonly jest: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
|
|
@@ -9,4 +10,5 @@ export declare const configs: {
|
|
|
9
10
|
readonly testingLibraryReact: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
|
|
10
11
|
readonly frontend: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
|
|
11
12
|
readonly frontendTypeChecking: (tsconfigRootDir: string) => import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
|
|
13
|
+
readonly next: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
|
|
12
14
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.configs = exports.config = void 0;
|
|
3
|
+
exports.configs = exports.gitignore = exports.config = void 0;
|
|
4
4
|
var base_1 = require("./base");
|
|
5
5
|
var frontend_1 = require("./frontend");
|
|
6
6
|
var jest_1 = require("./jest");
|
|
7
|
+
var next_1 = require("./next");
|
|
7
8
|
var testing_library_1 = require("./testing-library");
|
|
8
9
|
var typescript_1 = require("./typescript");
|
|
9
10
|
var typescript_eslint_1 = require("typescript-eslint");
|
|
10
11
|
Object.defineProperty(exports, "config", { enumerable: true, get: function () { return typescript_eslint_1.config; } });
|
|
12
|
+
var gitignore_1 = require("./gitignore");
|
|
13
|
+
Object.defineProperty(exports, "gitignore", { enumerable: true, get: function () { return gitignore_1.gitignore; } });
|
|
11
14
|
exports.configs = {
|
|
12
15
|
base: base_1.base,
|
|
13
16
|
jest: jest_1.jest,
|
|
@@ -18,4 +21,5 @@ exports.configs = {
|
|
|
18
21
|
testingLibraryReact: testing_library_1.testingLibraryReact,
|
|
19
22
|
frontend: frontend_1.frontend,
|
|
20
23
|
frontendTypeChecking: frontend_1.frontendTypeChecking,
|
|
24
|
+
next: next_1.next,
|
|
21
25
|
};
|
package/dist/next.d.ts
ADDED
package/dist/next.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.next = void 0;
|
|
18
|
+
var compat_1 = require("@eslint/compat");
|
|
19
|
+
var eslint_plugin_next_1 = __importDefault(require("@next/eslint-plugin-next"));
|
|
20
|
+
exports.next = [
|
|
21
|
+
{
|
|
22
|
+
plugins: {
|
|
23
|
+
// @ts-expect-error There is a bad typing atm
|
|
24
|
+
"@next/next": (0, compat_1.fixupPluginRules)(eslint_plugin_next_1.default),
|
|
25
|
+
},
|
|
26
|
+
rules: __assign({}, eslint_plugin_next_1.default.configs.recommended.rules),
|
|
27
|
+
},
|
|
28
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlaursen/eslint-config",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "An eslint config used by mlaursen for most projects.",
|
|
5
5
|
"repository": "https://github.com/mlaursen/eslint-config.git",
|
|
6
6
|
"author": "Mikkel Laursen <mlaursen03@gmail.com>",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@eslint/compat": "^1.2.0",
|
|
24
24
|
"@eslint/js": "^9.12.0",
|
|
25
|
+
"@next/eslint-plugin-next": "^14.2.15",
|
|
25
26
|
"@types/eslint__js": "^8.42.3",
|
|
26
27
|
"@typescript-eslint/utils": "^8.8.1",
|
|
27
28
|
"eslint-plugin-jest": "^28.8.3",
|