eslint-plugin-gb 9.0.0 → 9.1.0-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.
@@ -1,6 +1,6 @@
1
- import memberOrder from "../member-order.js";
1
+ const memberOrder = require("../member-order.js");
2
2
 
3
- export default [
3
+ module.exports = [
4
4
  {
5
5
  name: "gb/base/rules",
6
6
  rules: {
@@ -1,3 +1,6 @@
1
- import base from "./base.js";
1
+ const basePlugins = require("./base.js");
2
2
 
3
- export default [...base];
3
+ module.exports = basePlugins.map((p) => ({
4
+ ...p,
5
+ name: "gb/recommended/rules",
6
+ }));
@@ -1,4 +1,4 @@
1
- export default [
1
+ module.exports = [
2
2
  // Index signature
3
3
  "signature",
4
4
  "call-signature",
package/index.js CHANGED
@@ -1,11 +1,8 @@
1
- import fs from "fs";
1
+ const fs = require("fs");
2
+ const flatBase = require("./configs/flat/base.js");
3
+ const flatRecommended = require("./configs/flat/recommended.js");
2
4
 
3
- import flatRecommended from "./configs/flat/recommended.js";
4
- import flatBase from "./configs/flat/base.js";
5
-
6
- const pkg = JSON.parse(
7
- fs.readFileSync(new URL("./package.json", import.meta.url), "utf8"),
8
- );
5
+ const pkg = JSON.parse(fs.readFileSync("./package.json", "utf8"));
9
6
 
10
7
  const plugin = {
11
8
  meta: {
@@ -43,4 +40,4 @@ const plugin = {
43
40
  // ],
44
41
  // });
45
42
 
46
- export default plugin;
43
+ module.exports = plugin;
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "eslint-plugin-gb",
3
- "version": "9.0.0",
3
+ "version": "9.1.0-1",
4
4
  "description": "ESLint rules I like",
5
5
  "main": "index.js",
6
+ "scripts": {
7
+ "test": "npx jest"
8
+ },
6
9
  "peerDependencies": {
7
10
  "eslint": "^9.9.0"
8
11
  },
@@ -10,7 +13,7 @@
10
13
  "type": "git",
11
14
  "url": "git+https://github.com/GaryB432/eslint-plugin-gb.git"
12
15
  },
13
- "type": "module",
16
+ "type": "commonjs",
14
17
  "keywords": [
15
18
  "eslint",
16
19
  "eslint-plugin",
package/test.js ADDED
@@ -0,0 +1,18 @@
1
+ const plugin = require("./index");
2
+
3
+ describe("plugin", () => {
4
+ it("has correct plugin names", () => {
5
+ expect(Object.keys(plugin.configs).sort()).toEqual([
6
+ "flat/base",
7
+ "flat/recommended",
8
+ ]);
9
+ });
10
+
11
+ it("has correct plugin names", () => {
12
+ const rec = plugin.configs["flat/recommended"];
13
+ expect(rec[0]).toEqual({
14
+ name: "gb/recommended/rules",
15
+ rules: expect.any(Object),
16
+ });
17
+ });
18
+ });