-
Notifications
You must be signed in to change notification settings - Fork 2
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
Rewrite package on typescript #23
base: master
Are you sure you want to change the base?
Conversation
41ef2f1
to
751efda
Compare
149df46
to
2afb73b
Compare
2afb73b
to
1178c03
Compare
Запушил с переименованием файлов, теперь если смотреть по коммитам, то можно смотреть только на изменения, а не на весь файл |
2d637b1
to
fda2f4b
Compare
fda2f4b
to
a5f33b9
Compare
@@ -8,6 +8,7 @@ Config is described with a combination of a functions: | |||
var parser = root(section({ | |||
system: section({ | |||
parallelLimit: option({ | |||
defaultValue: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0
– не самый удачный пример дефолта. Кстати, в гермионе у этой опции дефолт Infinity
.
class UnknownKeysError extends Error { | ||
constructor(keys) { | ||
export class UnknownKeysError extends Error { | ||
keys: Array<string>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А это зачем?
|
||
export interface Locator<Options> extends Node<Options> { | ||
nested<Key extends keyof Options>(key: Key): Locator<Options[Key]>; | ||
resetOption(newOption: Options): Locator<Options>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Как-то не вяжется, что аргумент называется newOption
, а тип Options
– во множественном числе (как будто это массив).
}, | ||
"dependencies": { | ||
"lodash": "^4.17.4" | ||
}, | ||
"scripts": { | ||
"build": "tsc --build", | ||
"prepublishOnly": "npm run build", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь тоже вопрос, почему prepublishOnly
, а не prepack
?
https://github.com/gemini-testing/hermione-storybook/blob/master/package.json#L16
Кстати, еще вопрос: а не надо переименовывать папку |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В PR "Rewrite package on typescript" ожидаешь увидеть полный переезд на TS. Но при этом тесты остались на js. И структура пакета отличается от привычной в TS. Давай это исправим.
extends: 'gemini-testing', | ||
extends: ['gemini-testing', 'plugin:@typescript-eslint/recommended'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint'], | ||
root: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Немного странная последовательность опций. Я бы в такой последовательности описывал - https://github.com/gemini-testing/hermione-storybook/blob/master/.eslintrc.js
{ | ||
"extends": "@tsconfig/recommended/tsconfig.json", | ||
"include": ["lib"], | ||
"exclude": ["build", "test"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Странный exclude
. У тебя же эти папки в include
не попадают вообще.
Ну и почему сразу не сделать по нормальному? Т.е. не переименовать lib
в src
и в этот же src
положить тесты?
}, | ||
"dependencies": { | ||
"lodash": "^4.17.4" | ||
}, | ||
"scripts": { | ||
"build": "tsc --build", | ||
"prepublishOnly": "npm run build", | ||
"pretest": "npm run build", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачем на каждый test
запускать сборку?
@@ -0,0 +1,15 @@ | |||
{ | |||
"extends": "@tsconfig/recommended/tsconfig.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А что ты используешь из этого конфига то? Кажется, что он вообще не нужен
"compilerOptions": { | ||
"target": "ES2019", | ||
"outDir": "build", | ||
"allowJs": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ты же пакет переписал на ts
. Зачем тут эта опция?
"include": ["lib"], | ||
"exclude": ["build", "test"], | ||
"compilerOptions": { | ||
"target": "ES2019", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А какие ты фичи юзаешь из es2019? Спрашиваю так как обычно используем es2017
@@ -3,4 +3,5 @@ node_js: | |||
- '6' | |||
- '8' | |||
script: | |||
- npm build | |||
- npm test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А здесь у тебя за счет pretest
получится двойной запуск build
скрипта.
} | ||
|
||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
export interface OptionParserConfig<Value, MappedValue, Result = any> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не понял а для чего ты тут столько any
налупил? Давай хотя бы unknown
юзать.
No description provided.