Skip to content

Commit

Permalink
Update tsconfig.json
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jan 27, 2023
1 parent 6cf5dfe commit 17fa207
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
21 changes: 10 additions & 11 deletions complex-types.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
import type {Literal} from 'mdast'

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
export interface Math extends Literal {
type: 'math'
meta?: string | null
}

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
export interface InlineMath extends Literal {
type: 'inlineMath'
}
declare module 'mdast-util-from-markdown' {
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
interface CompileData {
Expand Down Expand Up @@ -41,17 +51,6 @@ declare module 'mdast-util-to-markdown' {
}
}

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
export interface Math extends Literal {
type: 'math'
meta?: string | null
}

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
export interface InlineMath extends Literal {
type: 'inlineMath'
}

declare module 'mdast' {
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
interface StaticPhrasingContentMap {
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle
* @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
* @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
* @typedef {import('./complex-types').Math} Math
* @typedef {import('./complex-types').InlineMath} InlineMath
* @typedef {import('./complex-types.js').Math} Math
* @typedef {import('./complex-types.js').InlineMath} InlineMath
*
* @typedef ToOptions
* @property {boolean} [singleDollarTextMath=true]
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@
"xo": "^0.53.0"
},
"scripts": {
"build": "rimraf \"{index,test}.d.ts\" && tsc && type-coverage",
"prepack": "npm run build && npm run format",
"build": "tsc --build --clean && tsc --build && type-coverage",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"test-api": "node --conditions development test.js",
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node --conditions development test.js",
"test-coverage": "c8 --check-coverage --100 --reporter lcov npm run test-api",
"test": "npm run build && npm run format && npm run test-coverage"
},
"prettier": {
Expand Down
17 changes: 9 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"include": ["*.js"],
"include": ["**/*.js", "complex-types.d.ts"],
"exclude": ["coverage/", "node_modules/"],
"compilerOptions": {
"target": "ES2020",
"lib": ["ES2020"],
"module": "ES2020",
"moduleResolution": "node",
"allowJs": true,
"checkJs": true,
"declaration": true,
"emitDeclarationOnly": true,
"allowSyntheticDefaultImports": true,
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"lib": ["es2020"],
"module": "node16",
"newLine": "lf",
"skipLibCheck": true,
"strict": true
"strict": true,
"target": "es2020"
}
}

0 comments on commit 17fa207

Please sign in to comment.