Skip to content

Commit e4a3469

Browse files
committed
fix: stylelint does not support es modules
1 parent c666db4 commit e4a3469

File tree

13 files changed

+24
-24
lines changed

13 files changed

+24
-24
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"sort-package-json": "sort-package-json packages/**/package.json",
2727
"test": "jest --config=./jest.config.cjs",
2828
"test:coverage": "jest --config=./jest.config.cjs --coverageDirectory=./coverage --coverage",
29-
"test:stylelint": "stylelint --formatter verbose --config ./packages/stylelint-config/index.js ./packages/stylelint-config/__tests__/css/**/*.css --syntax css",
29+
"test:stylelint": "stylelint --formatter verbose --config packages/stylelint-config/index.cjs ./packages/stylelint-config/__tests__/css/**/*.css --syntax css",
3030
"test:babel": "babel --config-file=./packages/babel-preset/index.js ./packages/babel-preset/fixture/test.ts --out-file=./packages/babel-preset/fixture/test.js"
3131
},
3232
"lint-staged": {

packages/stylelint-config/__tests__/index.tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Index from "./../index"
1+
import Index from "../index.cjs"
22

33
describe("eslint", () => {
44
it("should output no error", async () => {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const rules = [
2+
"./rules/a11y.cjs",
3+
"./rules/declaration-block-no-ignored-properties.cjs",
4+
"./rules/no-unsupported-browser-features.cjs",
5+
"./rules/rational-order.cjs",
6+
"./rules/require-units.cjs",
7+
"./rules/selector-no-empty.cjs",
8+
"./rules/standard.cjs",
9+
];
10+
11+
module.exports = {
12+
extends: rules.map(require.resolve),
13+
rules: {
14+
"indentation": 4,
15+
}
16+
};

packages/stylelint-config/index.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

packages/stylelint-config/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
"email": "[email protected]"
2222
},
2323
"type": "module",
24-
"main": "index.js",
24+
"main": "index.cjs",
2525
"files": [
2626
"lib",
27-
"index.js",
27+
"index.cjs",
2828
"rules",
2929
"README.md",
3030
"CHANGELOG.md",

packages/stylelint-config/rules/a11y.js renamed to packages/stylelint-config/rules/a11y.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default {
1+
module.exports = {
22
plugins: ["stylelint-a11y"],
33
rules: {
44
// Require certain styles if the animation or transition in media features

packages/stylelint-config/rules/best-practices.js renamed to packages/stylelint-config/rules/best-practices.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default {
1+
module.exports = {
22
rules: {
33
// Enabled to play well with both CSS and SCSS at-rules for readability.
44
// https://stylelint.io/user-guide/rules/at-rule-empty-line-before
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export default {
1+
module.exports = {
22
extends: ["stylelint-config-rational-order"],
33
};

0 commit comments

Comments
 (0)