Skip to content

Commit

Permalink
chore: remove babel, add typescript support (#33)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: requires minimum node v12.20.0
  • Loading branch information
plasticrake committed Jan 30, 2022
1 parent 18eb184 commit f460255
Show file tree
Hide file tree
Showing 11 changed files with 5,216 additions and 7,162 deletions.
18 changes: 0 additions & 18 deletions .babelrc

This file was deleted.

72 changes: 61 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,70 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2018,
project: ['./tsconfig.json', './tsconfig.eslint.json'],
},
env: {
browser: false,
commonjs: true,
node: true,
},
extends: ['airbnb-base', 'plugin:prettier/recommended'],
parserOptions: {
ecmaVersion: 2018,
},
reportUnusedDisableDirectives: true,
rules: {
'no-restricted-syntax': [
'off',
{
selector: 'ForOfStatement',

ignorePatterns: ['docs'],

overrides: [
{
files: ['*.ts'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
'airbnb-base',
'airbnb-typescript/base',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
rules: {
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': 'allow-with-description',
'ts-ignore': 'allow-with-description',
'ts-nocheck': 'allow-with-description',
'ts-check': 'allow-with-description',
},
],
'no-restricted-syntax': [
'off',
{
selector: 'ForOfStatement',
},
],
},
],
},
},

{
files: ['*.js'],
extends: ['airbnb-base', 'plugin:prettier/recommended'],
rules: {
'no-restricted-syntax': [
'off',
{
selector: 'ForOfStatement',
},
],
'import/extensions': 'off',
'import/no-unresolved': 'off',
},
},

{
files: ['examples/*.js', 'examples/*.ts'],
rules: {
'no-console': 'off',
'import/no-unresolved': 'off',
},
},
],
};
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build

# Logs
logs
*.log
Expand Down
2 changes: 1 addition & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extension": ["ts", "js"],
"recursive": true,
"require": ["@babel/register", "source-map-support/register"]
"require": ["ts-node/register", "source-map-support/register"]
}
12 changes: 4 additions & 8 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"require": [
"@babel/register"
],
"include": [
"src/**/*.js"
],
"extends": "@istanbuljs/nyc-config-typescript",
"all": true,
"sourceMap": false,
"instrument": false
"include": [
"src/**/*"
]
}

0 comments on commit f460255

Please sign in to comment.