Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Migrate to TypeScript and add type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarry committed Jul 8, 2021
1 parent cc1a5dc commit 4766279
Show file tree
Hide file tree
Showing 8 changed files with 401 additions and 330 deletions.
26 changes: 12 additions & 14 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
module.exports = {
extends: 'google',
env: {
node: true,
mocha: true
},
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'pabigot'
'@typescript-eslint',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'guard-for-in': 'off',
'prefer-rest-params': 'off',
'prefer-spread': 'off',
Expand All @@ -23,12 +27,6 @@ module.exports = {
'no-irregular-whitespace': ['error', {skipComments: true}],
'no-multi-spaces': ['error', {ignoreEOLComments: true}],
'operator-linebreak': ['error', 'before'],
'pabigot/affixed-ids': ['error', {
allowedSuffixes: [
'_dCel',
'_ppt'
]
}],
quotes: ['error', 'single', {
avoidEscape: true,
allowTemplateLiterals: true
Expand All @@ -40,6 +38,6 @@ module.exports = {
yoda: ['error', 'always', {exceptRange: true}]
},
parserOptions: {
sourceType: 'module'
project: './tsconfig.json',
}
}
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/CHANGELOG.html
/coverage/
/node_modules/
/lib/
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## [3.0.0] - 2021-07-08

* **API** Renamed `const` function to [constant][doc:constant].
* Migrate to TypeScript and make type definitions available from npm.

## [2.0.0] - 2021-07-08

* Improve [browser compatibility][pr#28] by adding a browser polyfill
Expand Down
25 changes: 16 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "buffer-layout",
"version": "2.0.0",
"version": "3.0.0",
"description": "Translation between JavaScript values and Buffers",
"keywords": [
"Buffer",
Expand All @@ -17,27 +17,34 @@
"license": "MIT",
"author": "Peter A. Bigot <[email protected]>",
"main": "./lib/Layout.js",
"types": "./lib/Layout.d.ts",
"files": [
"/lib"
],
"dependencies": {
"buffer": "~6.0.3"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.28.2",
"@typescript-eslint/parser": "^4.28.2",
"coveralls": "^3.0.0",
"eslint": "~4.18.2",
"eslint-config-google": "~0.9.1",
"eslint-plugin-pabigot": "~1.1.0",
"eslint": "~7.30.0",
"istanbul": "~0.4.5",
"jsdoc": "~3.5.5",
"lodash": "~4.17.5",
"mocha": "~5.0.4"
"mocha": "~5.0.4",
"typescript": "~4.3.5"
},
"engines": {
"node": ">=5.10"
},
"scripts": {
"coverage": "istanbul cover _mocha -- -u tdd",
"coveralls": "istanbul cover _mocha --report lcovonly -- -u tdd && cat ./coverage/lcov.info | coveralls",
"eslint": "eslint lib/ test/",
"build": "tsc",
"coverage": "npm run build && istanbul cover _mocha -- -u tdd",
"coveralls": "npm run build && istanbul cover _mocha --report lcovonly -- -u tdd && cat ./coverage/lcov.info | coveralls",
"eslint": "eslint src/ --ext .ts",
"jsdoc": "jsdoc -c jsdoc/conf.json",
"test": "mocha -u tdd"
"prepare": "npm run build",
"test": "npm run build && mocha -u tdd"
}
}
Loading

0 comments on commit 4766279

Please sign in to comment.