Skip to content
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

fix(refactor): complete migrate to stylelint v16 #263

Merged

Conversation

inomdzhon
Copy link
Contributor

@inomdzhon inomdzhon commented Feb 20, 2024

Note

Поехало форматирование, т.к. в репе нет prettier конфига и всё форматировалось по настройкам моего IDE.

В другом PR добавлю .prettierrc.

В PR #238 не до конца мигрировал конфиги. Это выяснилось при попытке починить линты в VKCOM/VKUI#6606.

Поэтому по рекомендациям https://stylelint.io/migration-guide/to-16 делаем следующие изменения:

  • добавляем в package.json поля "type": "module", "exports": "./index.js" и "module": "index.js";
  • в typescript.config.js задаём module и moduleResolution" как NodeNext. ⚠️ после этого в *.tsотносительных импортах используем расширение.js`;
  • заменяем module.exports на exports default;
  • jest.config.js тоже переписываем в ESM, а также задаём moduleNameMapper, чтобы резолвились относительные импорты с .js;

> [!NOTE]
>
> Поехало форматирование, т.к. нет в репе нет prettier конфига и всё форматировалось по настройкам моего IDE.
>
> В другом PR добавлю `.prettierrc`.

В PR #6341 не до конца мигрировал конфиги. Это выяснилось при попытке починить линты в VKCOM/VKUI#6606.

Поэтому по рекомендациям https://stylelint.io/migration-guide/to-16 делаем следующие изменения:

- добавляем в `package.json` поля `"type": "module"`, `"exports": "./index.js"` и `"module": "index.js"`;
- в `typescript.config.js` задаём `module` и `moduleResolution"  как `NodeNext`. ⚠️ после этого в `*.ts` относительных импортах используем расширение `.js`;
- заменяем `module.exports` на `exports default`;
- `jest.config.js` тоже переписываем в ESM, а также задаём `moduleNameMapper`, чтобы резолвились относительные импорты с `.js`;
@inomdzhon inomdzhon added the bug Something isn't working label Feb 20, 2024
@inomdzhon inomdzhon self-assigned this Feb 20, 2024
@inomdzhon inomdzhon added this to the v4.0.2 milestone Feb 20, 2024
@inomdzhon inomdzhon merged commit a96f896 into master Feb 20, 2024
1 check passed
@inomdzhon inomdzhon deleted the imirdzhamolov/fix/complete-migrate-to-stylelint-v16 branch February 20, 2024 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants