Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TypeScript infrastructure and typings #344

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
175 changes: 175 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,18 @@
"dist/lib/network.js": false,
"dist/lib/stream.js": false
},
"types": "./types/common.d.ts",
"readmeFilename": "README.md",
"files": [
"common.mjs",
"lib/",
"dist/"
"dist/",
"types/"
],
"scripts": {
"test": "npm run -s lint && metatests test/ && for test in ./sequential-test/*.js; do metatests \"$test\"; done",
"lint": "eslint . && prettier -c \"**/*.js\" \"**/*.json\" \"**/*.md\" \".*rc\" \"**/*.yml\"",
"fmt": "prettier --write \"**/*.js\" \"**/*.json\" \"**/*.md\" \".*rc\" \"**/*.yml\"",
"test": "npm run -s lint && tsc -p types/tsconfig.json && metatests test/ && for test in ./sequential-test/*.js; do metatests \"$test\"; done",
"lint": "eslint . && prettier -c \"**/*.js\" \"**/*.json\" \"**/*.md\" \".*rc\" \"**/*.yml\" \"**/*.d.ts\"",
"fmt": "prettier --write \"**/*.js\" \"**/*.json\" \"**/*.md\" \".*rc\" \"**/*.yml\" \"**/*.d.ts\"",
"doc": "metadoc",
"build": "babel common.js -d dist && babel lib -d dist/lib && node tools/esmodules-export-gen.js",
"prepublish": "npm run -s build"
Expand All @@ -54,12 +56,15 @@
"@babel/core": "^7.10.2",
"@babel/preset-env": "^7.10.2",
"@metarhia/doc": "^0.6.1",
"@typescript-eslint/eslint-plugin": "^3.6.0",
"@typescript-eslint/parser": "^3.6.0",
"eslint": "^6.8.0",
"eslint-config-metarhia": "^7.0.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-prettier": "^3.1.3",
"metatests": "^0.7.1",
"prettier": "1.19.x"
"prettier": "1.19.x",
"typescript": "^3.9.6"
}
}
16 changes: 16 additions & 0 deletions types/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'prettier'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': 'off',
// This rule doesn't work correctly without a special plugin for TS.
'import/no-unresolved': 'off',
},
};
1 change: 1 addition & 0 deletions types/common.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/iterator';
Loading