From c3fe107cab47fe42ff7eead2fd7ebe9bbfdd3af8 Mon Sep 17 00:00:00 2001 From: Christian Kaisermann Date: Mon, 3 Feb 2020 11:44:06 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20ramda=20and=20test?= =?UTF-8?q?-tools=20import=20messages=20(#42)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 🎸 add ramda and test-tools import messages * chore: 🤖 update changelog and add chan dep * chore: 🤖 remove wrong ci task --- .github/workflows/ci.yml | 14 -------------- package.json | 1 + packages/eslint-config-vtex/CHANGELOG.md | 2 ++ packages/eslint-config-vtex/rules/imports.js | 13 ++++++++++++- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad72373..7e03d15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,17 +9,3 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 - run: yarn && yarn lint - - Tests: - needs: [Lint] - runs-on: ubuntu-latest - steps: - - run: git config --global core.autocrlf false - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: 12 - - run: yarn - - run: cd node && yarn && yarn test - env: - CI: true diff --git a/package.json b/package.json index 944dea3..d65b6ce 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "postinstall": "lerna bootstrap && yarn build && lerna link" }, "devDependencies": { + "@geut/chan": "^2.1.1", "eslint": "^6.7.0", "husky": "^4.2.0", "lerna": "^3.18.4", diff --git a/packages/eslint-config-vtex/CHANGELOG.md b/packages/eslint-config-vtex/CHANGELOG.md index da23369..57b6fab 100644 --- a/packages/eslint-config-vtex/CHANGELOG.md +++ b/packages/eslint-config-vtex/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- Add warning message for lodash and @testing-library imports. ## [12.0.3] - 2020-01-24 ### Fixed diff --git a/packages/eslint-config-vtex/rules/imports.js b/packages/eslint-config-vtex/rules/imports.js index c0a1fb1..09087bd 100644 --- a/packages/eslint-config-vtex/rules/imports.js +++ b/packages/eslint-config-vtex/rules/imports.js @@ -8,7 +8,18 @@ module.exports = { 'no-restricted-imports': [ 'error', { - paths: ['lodash'], + paths: [ + { + name: 'lodash', + message: "Please use 'ramda' instead", + }, + { + name: '@testing-library/react', + message: "Please use '@vtex/test-tools/react' instead", + }, + ], + // Patterns don't support messages yet :( + // https://github.com/eslint/eslint/issues/11843 patterns: ['lodash/*'], }, ],