Skip to content

Commit

Permalink
feat: move to typescript/ESM (#1)
Browse files Browse the repository at this point in the history
This migrates to typescript and does the following:

- Adds support for ESM
- Adds prettier
- Adds google eslint config
- Bumps node CI versions
- Replaces testing with node built-ins
  • Loading branch information
43081j authored Jan 27, 2024
1 parent 7d7ed7a commit 6a5c491
Show file tree
Hide file tree
Showing 14 changed files with 1,829 additions and 116 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*]
end_of_line = lf
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
40 changes: 40 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"extends": [
"eslint:recommended",
"google",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"indent": "off",
"quote-props": "off",
"max-len": "error",
"eqeqeq": "error",
"no-unused-vars": "off",
"spaced-comment": "off",
"operator-linebreak": "off",
"comma-dangle": [
"error",
"never"
],
"quotes": [
"error",
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true
}
],
"@typescript-eslint/explicit-member-accessibility": "error",
"@typescript-eslint/member-delimiter-style": "error",
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/parameter-properties": "error",
"@typescript-eslint/no-inferrable-types": "off"
}
}
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ jobs:

strategy:
matrix:
node-version: [4.x, 6.x, 8.x, 9.x, 10.x, 12.x, 14.x, 16.x, 18.x, 19.x]
node-version: [16.x, 18.x, 19.x, 20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run tests-only
- run: npm ci
- run: npm run build && npm test

lint:
runs-on: ubuntu-latest
Expand All @@ -28,5 +28,5 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: lts/*
- run: npm install
- run: npm ci
- run: npm run lint
30 changes: 3 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
/node_modules
/lib
*.swp
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

10 changes: 10 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"bracketSpacing": false,
"printWidth": 80,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false,
"arrowParens": "always"
}
14 changes: 0 additions & 14 deletions index.d.ts

This file was deleted.

33 changes: 0 additions & 33 deletions index.js

This file was deleted.

Loading

0 comments on commit 6a5c491

Please sign in to comment.