Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: rewrites in TS; updates to TS setup
- Loading branch information
Showing
79 changed files
with
3,894 additions
and
2,350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,85 @@ | ||
const globals = require('eslint-restricted-globals'); | ||
const { EXT_JS, EXT_TS } = require('./project.config'); | ||
const { configs: ts } = require('@typescript-eslint/eslint-plugin'); | ||
|
||
module.exports = { | ||
root: true, | ||
parser: 'babel-eslint', | ||
extends: ['standard', 'plugin:import/errors', 'prettier'], | ||
env: { | ||
node: true, | ||
jest: true | ||
}, | ||
parserOptions: { | ||
impliedStrict: true | ||
impliedStrict: true, | ||
sourceType: 'module' | ||
}, | ||
plugins: ['prettier', 'jest', 'import', 'babel'], | ||
plugins: ['prettier', 'jest', 'import'], | ||
globals: {}, | ||
rules: { | ||
/* DISABLED */ | ||
'standard/no-callback-literal': 0, | ||
/* WARNINGS */ | ||
'no-warning-comments': [ | ||
1, | ||
{ terms: ['xxx', 'fixme', 'todo', 'refactor'], location: 'start' } | ||
], | ||
'no-unused-vars': 1, | ||
'no-console': 1, | ||
'jsx-a11y/no-autofocus': 0, | ||
/* ERRORS */ | ||
// Add custom globals | ||
'no-restricted-globals': [2, 'fetch'].concat(globals), | ||
// eslint-plugin-babel | ||
'babel/no-invalid-this': 1, | ||
'babel/semi': 1, | ||
// Prettier | ||
'prettier/prettier': [2, require('./.prettierrc')] | ||
}, | ||
settings: { | ||
// babel-plugin-module-resolver | ||
'import/resolver': { | ||
'babel-module': {} | ||
overrides: [ | ||
/* JAVASCRIPT */ | ||
{ | ||
files: [`*.{${EXT_JS}}`], | ||
parser: 'babel-eslint', | ||
plugins: ['babel'], | ||
rules: { | ||
'babel/no-invalid-this': 1, | ||
'babel/semi': 1 | ||
}, | ||
settings: { | ||
// babel-plugin-module-resolver | ||
'import/resolver': { | ||
'babel-module': {} | ||
} | ||
} | ||
}, | ||
// eslint-import-resolver-typescript | ||
'import/resolver': { | ||
typescript: {} | ||
/* TYPESCRIPT */ | ||
{ | ||
files: [`*.{${EXT_TS}}`], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint'], | ||
// Overrides don't allow for extends | ||
rules: Object.assign(ts.recommended.rules, { | ||
/* DISABLED */ | ||
'@typescript-eslint/indent': 0, | ||
'@typescript-eslint/no-explicit-any': 0, | ||
'@typescript-eslint/no-object-literal-type-assertion': 0, | ||
'@typescript-eslint/explicit-function-return-type': 0, | ||
/* WARNINGS */ | ||
'@typescript-eslint/no-unused-vars': [ | ||
1, | ||
{ | ||
args: 'after-used', | ||
argsIgnorePattern: '_.*', | ||
ignoreRestSiblings: true | ||
} | ||
], | ||
/* ERRORS */ | ||
'@typescript-eslint/interface-name-prefix': [2, 'always'], | ||
'@typescript-eslint/no-use-before-define': [2, { functions: false }], | ||
'@typescript-eslint/array-type': [2, 'array-simple'] | ||
}), | ||
settings: { | ||
// eslint-import-resolver-typescript | ||
'import/resolver': { | ||
typescript: {} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# markdown-spellcheck spelling configuration file | ||
# Format - lines beginning # are comments | ||
# global dictionary is at the start, file overrides afterwards | ||
# one word per line, to define a file override use ' - filename' | ||
# where filename is relative to this configuration file | ||
CLI | ||
programatically | ||
programatic | ||
boolean | ||
async | ||
transpiling | ||
ESLint | ||
TSLint | ||
TypeDoc | ||
TravisCI | ||
repo | ||
config | ||
npm | ||
js | ||
api | ||
transpiled | ||
typings | ||
JSON | ||
transpile | ||
Promist | ||
truthy | ||
falsy | ||
utils | ||
thenable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
require('./setup/jake'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const { CONFIG_DIR } = require('./project.config'); | ||
|
||
const JAKE_DIR = path.join(CONFIG_DIR, 'scripts/tasks'); | ||
|
||
(function run(dir = JAKE_DIR) { | ||
fs.readdirSync(dir).forEach((name) => { | ||
const item = path.join(dir, name); | ||
|
||
if (fs.statSync(item).isDirectory()) { | ||
if (name === 'root') run(item); | ||
else namespace(name, () => run(item)); | ||
} else if (/\.jake\.js$/.exec(item)) { | ||
require(item); | ||
} | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const { EXT_JS, EXT_TS } = require('./project.config'); | ||
const EXT = EXT_JS + ',' + EXT_TS; | ||
const EXT_ARR = EXT.split(',').map((x) => x.trim()); | ||
|
||
module.exports = { | ||
testEnvironment: 'node', | ||
collectCoverage: true, | ||
collectCoverageFrom: [`<rootDir>/src/**/*.{${EXT}}`], | ||
modulePathIgnorePatterns: [ | ||
'<rootDir>/lib', | ||
'<rootDir>/src/@types', | ||
'<rootDir>/src/bin' | ||
], | ||
moduleFileExtensions: EXT_ARR.concat(['json']), | ||
testPathIgnorePatterns: ['/node_modules/'] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
"experimentalDecorators": true, | ||
"baseUrl": ".", | ||
"paths": { | ||
"*": ["src/lib/*"], | ||
"~/*": ["src/*"] | ||
} | ||
} | ||
|
Oops, something went wrong.