Skip to content

Commit

Permalink
feat: rewrite in TypeScript as ESM
Browse files Browse the repository at this point in the history
BREAKING CHANGE: tablemark must be used as an ES module and is no longer available as common js.
  • Loading branch information
haltcase committed Oct 20, 2021
1 parent 21b6d9e commit feb3dd1
Show file tree
Hide file tree
Showing 18 changed files with 735 additions and 443 deletions.
38 changes: 38 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"use strict"

const [, , error] = ["off", "warn", "error"]

module.exports = {
extends: ["./node_modules/ts-standardx/.eslintrc.js"],
ignorePatterns: ["dist"],
rules: {
"no-unused-vars": [
error,
{
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
varsIgnorePattern: "^_"
}
],
quotes: [error, "double"],

"prettier/prettier": [
error,
{
semi: false,
singleQuote: false,
trailingComma: "none",
bracketSameLine: true,
arrowParens: "avoid"
}
]
},
overrides: [
{
files: ["**/*.{ts,tsx}"],
rules: {
"@typescript-eslint/quotes": [error, "double"]
}
}
]
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ package-lock.json
yarn.lock

node_modules

/dist
10 changes: 10 additions & 0 deletions ava.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default {
extensions: {
ts: "module"
},
nonSemVerExperiments: {
configurableModuleFormat: true,
nextGenConfig: true
},
nodeArguments: ["--loader=ts-node/esm"]
}
9 changes: 9 additions & 0 deletions declarations.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
declare module "split-text-to-chunks" {
interface Split {
width: (text: string, max: number) => number
(text: string, columns: number): string
}

const split: Split
export default split
}
197 changes: 0 additions & 197 deletions fixtures/inputs.js

This file was deleted.

25 changes: 0 additions & 25 deletions index.d.ts

This file was deleted.

Loading

0 comments on commit feb3dd1

Please sign in to comment.