atls-lab / config Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
@atlantis-lab/config не находит prettier config тк он описан в ESM формате, а вызывается через commonjs
import config from '@atlantis-lab/config/prettier.config'
console.log(config)
конфиг импортируется
atls/tools#119 - задача родитель
Объекты конфигов экспортируется в неверном формате
Шаги для воспроизведения бага:
Ошибок быть не должно
Пример запуска jest используя конфиг из репы:
Unknown option "default" with value
{"collectCoverageFrom": ["**/*.{js,jsx,ts,tsx}", "!**/*.d.ts"], "coverageDirectory": "<rootDir>/coverage", "globals": {"ts-jest": {"tsConfig": {"allowJs": true}}}, "moduleNameMapper": {"^.+\\.(jpg|jpeg|gif|png|mp4|mkv|avi|webm|swf|wav|mid)$": "jest-static-stubs/$1"}, "modulePathIgnorePatterns": ["dist"], "preset": "ts-jest/presets/js-with-ts", "rootDir": "/media/darius/6E4CBE7A4CBE3D21/atlantis/atlantis/actl/actl", "snapshotSerializers": ["jest-emotion"], "testRegex": "/(__tests__|e2e)/.*\\.(test|spec)\\.(ts|tsx|js)$"} was found.
This is probably a typing mistake. Fixing it will remove this message.
В задачах #83 и atls/tools#100 проблемой был поломанный функционал пакетов. Его ломал метод экспорта конфигов через export default
, так что временно его пришлось заменить на cjs'ный module.exports
При экспорте создавался объект с high-level property, что некорректно. В случае с export default
high-level propety - это default
, в котором леэал сам конфиг. Такое свойство так же создается при обычном export
после компиляции кода.
Конфиги экспортируются с использованием ESM синтаксиса и все работает
См. referenced issue выше
@atlantis-lab/[email protected]
Обновление некоторых зависимостей поломало обратную совместимость плагинов линтера, из-за чего тот не выполняет 90% своей работы
Шаги для воспроизведения бага:
Линтер должен работать на всех файлах, и все плагины должны отрабатывать корректно
Пример ошибки:
Error: Comment "eslint-disable" was not printed. Please report this error!
Вариаций ошибок много, но все появляются из-за того, что те или иные плагины не работают
При попытке сделать коммит у нас на проектах висят husky с хуками на precommit и commit-msg, если в стейдже нет файлов мы ловим ошибку после чего коммит прерывается.
Шаги для воспроизведения бага:
линт-стейджед ничего не нашёл, мы успешно коммитнули файлы
husky > pre-commit (node v14.14.0)
Could not parse lint-staged config.
Error: ● Validation Error:
Invalid value for 'default'.
Should be a string, a function, or an array of strings and functions.
Configured value is: {'*.{js,ts,tsx,yml,yaml,json,graphql,md}': ['prettier --write --config /Users/torinasakura/workspace/atlantis/serenity/node_modules/@atlantis-lab/prettier-config/dist/index.js --ignore-path /Users/torinasakura/workspace/atlantis/serenity/node_modules/@atlantis-lab/prettier-config/.prettierignore', 'git add'], '*.{ts,tsx}': ['bash -c "tsc --noEmit"'], '*.{js,jsx,ts,tsx}': ['eslint --fix --config /Users/torinasakura/workspace/atlantis/serenity/node_modules/@atlantis-lab/eslint-config/dist/index.js', 'jest --config /Users/torinasakura/workspace/atlantis/serenity/node_modules/@atlantis-lab/jest-config/dist/index.js --bail --findRelatedTests', 'git add']}
Please refer to https://github.com/okonet/lint-staged#configuration for more information...
Please make sure you have created it correctly.
See https://github.com/okonet/lint-staged#configuration.
husky > pre-commit hook failed (add --no-verify to bypass)
/Users/torinasakura/workspace/atlantis/serenity/node_modules/commitizen/dist/cli/strategies/git-cz.js:85
throw error;
^
Error: git exited with error code 1
at ChildProcess.<anonymous> (/Users/torinasakura/workspace/atlantis/serenity/node_modules/commitizen/dist/git/commit.js:807:28)
at ChildProcess.emit (events.js:315:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
code: 1,
signal: null
}
Конфиги экспортируются без ключевого слова
export default {}
из-за чего @atlantis-lab/actl-lint и @atlantis-lab/actl-test не находят конфиг
Убрать ненужное свойство из конфига
extends: ['airbnb-typescript', 'prettier/react', 'plugin:prettier/recommended'],
На
extends: ['airbnb-typescript', 'plugin:prettier/recommended'],
@atlantis-lab/[email protected]
Старая зависимость мешает работе линтера
Шаги для воспроизведения бага:
Зависимость должна быть свежей, линтер должен работать
TypeError: path.match is not a function
@atlantis-lab/[email protected]
Линтер перестал работать
Шаги для воспроизведения бага:
Ошибок быть не должно и линтер должен запуститься
Error: Error while loading rule '@typescript-eslint/dot-notation':
You have used a rule which requires parserServices to be generated.
You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.