Skip to content

Commit e0bd7bb

Browse files
committed
fix: use cjs and specify commonjs type package
1 parent b900ceb commit e0bd7bb

24 files changed

+60
-41
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"extends": "./strict",
2+
"extends": "eslint-config-atomic/strict",
33
"ignorePatterns": ["dist/", "node_modules/"]
44
}

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require("./dist/index.js").default
1+
module.exports = require("./dist/index.cjs").default

package.json

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,22 @@
55
"repository": "https://github.com/atom-ide-community/eslint-config-atomic",
66
"license": "MIT",
77
"author": "Amin Yahyaabadi",
8-
"main": "index.js",
8+
"type": "commonjs",
9+
"main": "index.cjs",
910
"files": [
1011
"src",
1112
"dist",
12-
"*.js"
13+
"*.cjs"
1314
],
1415
"scripts": {
1516
"build": "tsc",
1617
"bump": "ncu -u -x coffeescript,execa,read-pkg-up",
17-
"clean": "shx rm -rf ./spec/fixtures/atom-community ./spec/fixtures/atom-minimap ./spec/fixtures/steelbrain ./strict.js ./strict-react.js",
18+
"clean": "shx rm -rf ./spec/fixtures/ ./dist",
1819
"format": "prettier --write .",
1920
"lint": "eslint . --ignore-pattern ./spec/fixtures/ --fix",
20-
"prepare": "npm run build",
21-
"test": "node ./spec/test.js",
21+
"prepare": "pnpm run build",
22+
"prepublishOnly": "pnpm run clean && pnpm run build",
23+
"test": "node ./spec/test.cjs",
2224
"test.format": "prettier . --check",
2325
"test.lint": "eslint . --ignore-pattern spec/fixtures/**"
2426
},
@@ -58,11 +60,13 @@
5860
"@types/read-pkg-up": "^6.0.0",
5961
"@types/semver": "^7.5.3",
6062
"@types/shelljs": "^0.8.13",
63+
"eslint-config-atomic": "link:",
6164
"execa": "^5.1.1",
6265
"gitly": "^2.4.5",
6366
"npm-check-updates": "16.14.4",
6467
"prettier-config-atomic": "^3.1.0",
65-
"shelljs": "^0.8.5"
68+
"shelljs": "^0.8.5",
69+
"shx": "^0.3.4"
6670
},
6771
"peerDependencies": {
6872
"eslint": "^8 || ^7 || ^6"
@@ -80,7 +84,7 @@
8084
"lint",
8185
"prettier"
8286
],
83-
"react": "react.js",
84-
"strict": "strict.js",
85-
"strict-react": "strict-react.js"
86-
}
87+
"react": "react.cjs",
88+
"strict": "strict.cjs",
89+
"strict-react": "strict-react.cjs"
90+
}

pnpm-lock.yaml

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require("./dist/index-react.js").default
1+
module.exports = require("./dist/index-react.cjs").default
File renamed without changes.

src/coffeescript.ts renamed to src/coffeescript.cts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { pluginNodeRules } from "./plugin-node-rules.js"
2-
import { pluginImportRulesExtra } from "./plugin-import-rules.js"
1+
import { pluginNodeRules } from "./plugin-node-rules.cjs"
2+
import { pluginImportRulesExtra } from "./plugin-import-rules.cjs"
33

44
export const coffeeConfig = {
55
// CoffeeScript files

src/cson.ts renamed to src/cson.cts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { coffeeConfig } from "./coffeescript.js"
1+
import { coffeeConfig } from "./coffeescript.cjs"
22

33
export const csonConfig = {
44
...coffeeConfig,

src/eslint-version.ts renamed to src/eslint-version.cts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import child_process from "child_process"
22
import eslintPackageJson from "eslint/package.json"
33

44
export function getEslintVersion() {
5-
if (process.argv[1].includes("eslint.js")) {
5+
if (process.argv[1].includes("eslint.cjs")) {
66
const eslintVersion = child_process.execFileSync(process.argv[0], [process.argv[1], "--version"], {
77
encoding: "utf8",
88
stdio: "pipe",
File renamed without changes.

0 commit comments

Comments
 (0)