eslint-plugin-gb 9.1.0-0 → 9.1.0-2

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,10 +1,7 @@
1
- import fs from "fs";
2
- import flatBase from "./configs/flat/base.js";
3
- import flatRecommended from "./configs/flat/recommended.js";
1
+ const flatBase = require("./configs/flat/base.js");
2
+ const flatRecommended = require("./configs/flat/recommended.js");
4
3
 
5
- const pkg = JSON.parse(
6
- fs.readFileSync(new URL("./package.json", import.meta.url), "utf8")
7
- );
4
+ const pkg = require("./package.json");
8
5
 
9
6
  const plugin = {
10
7
  meta: {
@@ -42,4 +39,4 @@ const plugin = {
42
39
  // ],
43
40
  // });
44
41
 
45
- export default plugin;
42
+ module.exports = plugin;
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "eslint-plugin-gb",
3
- "version": "9.1.0-0",
3
+ "version": "9.1.0-2",
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
  },
package/test.js ADDED
@@ -0,0 +1,25 @@
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 config name", () => {
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
+
19
+ it("has correct plugin meta", () => {
20
+ expect(plugin.meta).toEqual({
21
+ name: "eslint-plugin-gb",
22
+ version: expect.any(String),
23
+ });
24
+ });
25
+ });