Skip to content

Commit d8762fa

Browse files
authored
feat(markuplint-config): add types support (#294)
1 parent 8c27a97 commit d8762fa

File tree

12 files changed

+378
-46
lines changed

12 files changed

+378
-46
lines changed

.changeset/giant-turkeys-call.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@1stg/markuplint-config": major
3+
---
4+
5+
feat(markuplint-config): bump `markuplint` to v4, migrate to pure ESM, add types support

.markuplintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"extends": [
33
"@1stg/markuplint-config/angular",
4-
"@1stg/markuplint-config/svelte",
54
"@1stg/markuplint-config/vue"
65
]
76
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"eslint": "^9.22.0",
4242
"eslint-config-prettier": "^10.1.1",
4343
"lint-staged": "^15.4.3",
44+
"markuplint": "^4.11.7",
4445
"npm-run-all2": "^7.0.2",
4546
"postcss": "^8.5.3",
4647
"postcss-load-config": "^6.0.1",

packages/markuplint-config/angular.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
module.exports = {
2-
...require('./base'),
1+
import base from './base.js'
2+
3+
export default {
4+
...base,
35
parser: {
46
'\\.html$': 'markuplint-angular-parser',
57
},

packages/markuplint-config/base.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { Config } from '@markuplint/ml-config'
2+
3+
const base: Config
4+
export default base

packages/markuplint-config/base.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
module.exports = {
1+
/**
2+
* @import {Config} from '@markuplint/ml-config'
3+
* @type {Config}
4+
*/
5+
const base = {
26
extends: ['markuplint:recommended'],
37
rules: {
48
'attr-duplication': true,
@@ -10,3 +14,5 @@ module.exports = {
1014
},
1115
excludeFiles: ['**/node_modules/**'],
1216
}
17+
18+
export default base

packages/markuplint-config/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from './base.js'

packages/markuplint-config/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('./base')
1+
export { default } from './base.js'

packages/markuplint-config/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@1stg/markuplint-config",
33
"version": "3.0.1",
4+
"type": "module",
45
"description": "Personal but Shareable markuplint Configuration for all 1stG.me projects",
56
"repository": "git+https://github.com/1stG/configs.git",
67
"homepage": "https://github.com/1stG/configs/tree/master/packages/markuplint-config",
@@ -10,6 +11,13 @@
1011
"engines": {
1112
"node": "^14.18.0 || >=16.0.0"
1213
},
14+
"main": "index.js",
15+
"exports": {
16+
".": "./index.js",
17+
"./package.json": "./package.json",
18+
"./angular": "./angular.js",
19+
"./vue": "./vue.js"
20+
},
1321
"peerDependencies": {
1422
"markuplint": "^4.0.0"
1523
},

packages/markuplint-config/vue.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { Config } from '@markuplint/ml-config'
2+
3+
const vue: Config
4+
export default vue

0 commit comments

Comments
 (0)