-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(typescript): move to typescript and fix eslint errors
- Loading branch information
Showing
20 changed files
with
9,795 additions
and
5,112 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
module.exports = { | ||
extends: ['prettier'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: ['tsconfig.test.json'], | ||
sourceType: 'module' | ||
}, | ||
plugins: ['prefer-arrow', '@typescript-eslint', 'import', 'jest'], | ||
rules: { | ||
'import/order': [ | ||
'error', | ||
{ | ||
pathGroups: [ | ||
{ | ||
pattern: '^[a-zA-Z]', | ||
group: 'builtin', | ||
position: 'after' | ||
} | ||
], | ||
pathGroupsExcludedImportTypes: ['builtin'], | ||
groups: [['builtin', 'external'], 'internal', 'parent', 'sibling'], | ||
'newlines-between': 'always', | ||
alphabetize: { | ||
order: 'asc' | ||
} | ||
} | ||
], | ||
'@typescript-eslint/adjacent-overload-signatures': 'error', | ||
'@typescript-eslint/array-type': [ | ||
'error', | ||
{ | ||
default: 'array' | ||
} | ||
], | ||
'@typescript-eslint/ban-types': [ | ||
'error', | ||
{ | ||
types: { | ||
Object: { | ||
message: 'Avoid using the `Object` type. Did you mean `object`?' | ||
}, | ||
Function: { | ||
message: 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.' | ||
}, | ||
Boolean: { | ||
message: 'Avoid using the `Boolean` type. Did you mean `boolean`?' | ||
}, | ||
Number: { | ||
message: 'Avoid using the `Number` type. Did you mean `number`?' | ||
}, | ||
String: { | ||
message: 'Avoid using the `String` type. Did you mean `string`?' | ||
}, | ||
Symbol: { | ||
message: 'Avoid using the `Symbol` type. Did you mean `symbol`?' | ||
} | ||
} | ||
} | ||
], | ||
'@typescript-eslint/consistent-type-assertions': 'error', | ||
'@typescript-eslint/dot-notation': 'error', | ||
'@typescript-eslint/indent': 'off', | ||
'@typescript-eslint/member-delimiter-style': [ | ||
'off', | ||
{ | ||
multiline: { | ||
delimiter: 'none', | ||
requireLast: true | ||
}, | ||
singleline: { | ||
delimiter: 'semi', | ||
requireLast: false | ||
} | ||
} | ||
], | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/no-empty-interface': 'error', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-misused-new': 'error', | ||
'@typescript-eslint/no-namespace': 'error', | ||
'@typescript-eslint/no-parameter-properties': 'off', | ||
'@typescript-eslint/no-shadow': [ | ||
'error', | ||
{ | ||
hoist: 'all' | ||
} | ||
], | ||
'@typescript-eslint/no-this-alias': 'error', | ||
'@typescript-eslint/no-unused-expressions': 'error', | ||
'@typescript-eslint/no-use-before-define': 'off', | ||
'@typescript-eslint/no-var-requires': 'error', | ||
'@typescript-eslint/prefer-for-of': 'error', | ||
'@typescript-eslint/prefer-function-type': 'error', | ||
'@typescript-eslint/prefer-namespace-keyword': 'error', | ||
'@typescript-eslint/quotes': 'off', | ||
'@typescript-eslint/semi': ['off', null], | ||
'@typescript-eslint/triple-slash-reference': [ | ||
'error', | ||
{ | ||
path: 'always', | ||
types: 'prefer-import', | ||
lib: 'always' | ||
} | ||
], | ||
'@typescript-eslint/type-annotation-spacing': 'off', | ||
'@typescript-eslint/unified-signatures': 'error', | ||
'arrow-parens': ['off', 'always'], | ||
'brace-style': ['off', 'off'], | ||
'comma-dangle': 'off', | ||
complexity: 'off', | ||
'constructor-super': 'error', | ||
'eol-last': 'off', | ||
eqeqeq: ['error', 'smart'], | ||
'guard-for-in': 'error', | ||
'id-blacklist': [ | ||
'error', | ||
'any', | ||
'Number', | ||
'number', | ||
'String', | ||
'string', | ||
'Boolean', | ||
'boolean', | ||
'Undefined', | ||
'undefined' | ||
], | ||
'id-match': 'error', | ||
'linebreak-style': 'off', | ||
'max-classes-per-file': ['error', 1], | ||
'max-len': 'off', | ||
'new-parens': 'off', | ||
'newline-per-chained-call': 'off', | ||
'no-bitwise': 'error', | ||
'no-caller': 'error', | ||
'no-cond-assign': 'error', | ||
'no-console': 'off', | ||
'no-debugger': 'error', | ||
'no-duplicate-case': 'error', | ||
'no-duplicate-imports': 'error', | ||
'no-empty': 'off', | ||
'no-eval': 'error', | ||
'no-extra-bind': 'error', | ||
'no-extra-semi': 'off', | ||
'no-fallthrough': 'off', | ||
'no-invalid-this': 'off', | ||
'no-irregular-whitespace': 'off', | ||
'no-multiple-empty-lines': 'off', | ||
'no-new-func': 'error', | ||
'no-new-wrappers': 'error', | ||
'no-redeclare': 'error', | ||
'no-return-await': 'error', | ||
'no-sequences': 'error', | ||
'no-sparse-arrays': 'error', | ||
'no-template-curly-in-string': 'error', | ||
'no-throw-literal': 'error', | ||
'no-trailing-spaces': 'off', | ||
'no-undef-init': 'error', | ||
'no-underscore-dangle': 'error', | ||
'no-unsafe-finally': 'error', | ||
'no-unused-labels': 'error', | ||
'no-var': 'error', | ||
'object-shorthand': 'error', | ||
'one-var': ['error', 'never'], | ||
'prefer-arrow/prefer-arrow-functions': 'error', | ||
'prefer-const': 'error', | ||
'prefer-object-spread': 'error', | ||
'quote-props': 'off', | ||
radix: 'error', | ||
'space-before-function-paren': 'off', | ||
'space-in-parens': ['off', 'never'], | ||
'spaced-comment': [ | ||
'error', | ||
'always', | ||
{ | ||
markers: ['/'] | ||
} | ||
], | ||
'use-isnan': 'error', | ||
'valid-typeof': 'off' | ||
} | ||
}; |
File renamed without changes.
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ node_modules | |
# for Jetbrains IDEA ides | ||
.idea | ||
coverage | ||
.now | ||
.now | ||
dist |
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,11 @@ | ||
module.exports = { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { node: 'current' } | ||
} | ||
], | ||
'@babel/preset-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,5 @@ | ||
#!/usr/bin/env node | ||
'use strict'; | ||
|
||
const { program } = require('commander'); | ||
|
||
const { generate } = require('../cmds'); | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
const { version } = require('../package.json'); | ||
|
||
program.version(version).description('a CLI Tool to generate markdown files for vuepress'); | ||
|
||
program | ||
.description('Generate the md files') | ||
.option('-s, --source <string>', 'Source folder with .js or .ts files', './src') | ||
.option('-d, --dist <string>', 'Destination folder', './documentation') | ||
.option('-f, --folder <string>', 'Folder inside destination folder. Gets overwritten everytime', 'code') | ||
.option('-t, --title <string>', 'Title of your documentation', 'API') | ||
.option('-r, --readme <string>', 'Path to your custom readme') | ||
.option('-e, --exclude <string>', 'Pattern to exclude files/folders (Comma seperated) - *.test.js,exclude.js') | ||
.option( | ||
'-rm, --rmPattern [files...]', | ||
'Pattern when removing files. You can ex- and include files. (glob pattern)', | ||
[] | ||
) | ||
.option('-p, --partials [files...]', 'jsdoc2markdown partial templates (overwrites default ones)', []) | ||
.option('-c, --jsDocConfigPath <string>', 'Path to jsdoc config') | ||
.action(generate); | ||
|
||
program.parse(process.argv); | ||
require('../dist/cmds').default(version); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.