feat!: module & commonjs in stylelint

BREAKING CHANGE: support module, and commonjs types
This commit is contained in:
Ismo Vuorinen
2024-08-21 17:35:13 +03:00
parent ce9de621f6
commit e4aed31ef9
7 changed files with 28 additions and 9 deletions

View File

@@ -1,5 +1,3 @@
{ {
"extends": [ "extends": ["@ivuorinen/stylelint-config/css"]
"@ivuorinen/stylelint-config/css" }
]
}

View File

@@ -0,0 +1,2 @@
import config from './index.cjs'
export default config

View File

@@ -1,6 +1,7 @@
{ {
"name": "@ivuorinen/stylelint-config", "name": "@ivuorinen/stylelint-config",
"version": "0.2.37", "version": "0.2.37",
"type": "module",
"description": "ivuorinen's shareable configuration for stylelint.", "description": "ivuorinen's shareable configuration for stylelint.",
"author": { "author": {
"name": "Ismo Vuorinen", "name": "Ismo Vuorinen",
@@ -12,10 +13,26 @@
"engines": { "engines": {
"node": ">= 18" "node": ">= 18"
}, },
"main": "css/index.cjs",
"module": "css/index.mjs",
"exports": {
".": {
"import": "./css/index.mjs",
"require": "./css/index.cjs"
},
"./css": {
"import": "./scss/index.mjs",
"require": "./scss/index.cjs"
},
"./scss": {
"import": "./scss/index.mjs",
"require": "./scss/index.cjs"
}
},
"files": [ "files": [
"css/index.js", "css/*",
"scripts/*", "scss/*",
"scss/index.js" "scripts/*"
], ],
"homepage": "https://github.com/ivuorinen/base-configs/tree/main/packages/stylelint-config#readme", "homepage": "https://github.com/ivuorinen/base-configs/tree/main/packages/stylelint-config#readme",
"keywords": [ "keywords": [
@@ -25,7 +42,6 @@
"ivuorinen" "ivuorinen"
], ],
"license": "MIT", "license": "MIT",
"main": "css/index.js",
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },
@@ -34,7 +50,7 @@
"url": "https://github.com/ivuorinen/base-configs.git" "url": "https://github.com/ivuorinen/base-configs.git"
}, },
"scripts": { "scripts": {
"postinstall": "node scripts/postinstall.js" "postinstall": "node scripts/postinstall.cjs"
}, },
"dependencies": { "dependencies": {
"@ivuorinen/config-checker": "^1.1.4", "@ivuorinen/config-checker": "^1.1.4",

View File

@@ -2,6 +2,7 @@
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
// noinspection NpmUsedModulesInstalled
const process = require('process') const process = require('process')
const checkConfig = require('@ivuorinen/config-checker') const checkConfig = require('@ivuorinen/config-checker')
const foundConfig = checkConfig('stylelint') const foundConfig = checkConfig('stylelint')

View File

@@ -0,0 +1,2 @@
import config from './index.cjs'
export default config