Skip to content

Commit feb3dd1

Browse files
committed
feat: rewrite in TypeScript as ESM
BREAKING CHANGE: tablemark must be used as an ES module and is no longer available as common js.
1 parent 21b6d9e commit feb3dd1

18 files changed

+735
-443
lines changed

.eslintrc.cjs

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
"use strict"
2+
3+
const [, , error] = ["off", "warn", "error"]
4+
5+
module.exports = {
6+
extends: ["./node_modules/ts-standardx/.eslintrc.js"],
7+
ignorePatterns: ["dist"],
8+
rules: {
9+
"no-unused-vars": [
10+
error,
11+
{
12+
argsIgnorePattern: "^_",
13+
caughtErrorsIgnorePattern: "^_",
14+
varsIgnorePattern: "^_"
15+
}
16+
],
17+
quotes: [error, "double"],
18+
19+
"prettier/prettier": [
20+
error,
21+
{
22+
semi: false,
23+
singleQuote: false,
24+
trailingComma: "none",
25+
bracketSameLine: true,
26+
arrowParens: "avoid"
27+
}
28+
]
29+
},
30+
overrides: [
31+
{
32+
files: ["**/*.{ts,tsx}"],
33+
rules: {
34+
"@typescript-eslint/quotes": [error, "double"]
35+
}
36+
}
37+
]
38+
}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ package-lock.json
99
yarn.lock
1010

1111
node_modules
12+
13+
/dist

ava.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export default {
2+
extensions: {
3+
ts: "module"
4+
},
5+
nonSemVerExperiments: {
6+
configurableModuleFormat: true,
7+
nextGenConfig: true
8+
},
9+
nodeArguments: ["--loader=ts-node/esm"]
10+
}

declarations.d.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
declare module "split-text-to-chunks" {
2+
interface Split {
3+
width: (text: string, max: number) => number
4+
(text: string, columns: number): string
5+
}
6+
7+
const split: Split
8+
export default split
9+
}

fixtures/inputs.js

-197
This file was deleted.

index.d.ts

-25
This file was deleted.

0 commit comments

Comments
 (0)