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

[BUG] Border-DEFAULT is not working. #334

Closed
medAzizRezgui opened this issue Apr 21, 2024 · 4 comments
Closed

[BUG] Border-DEFAULT is not working. #334

medAzizRezgui opened this issue Apr 21, 2024 · 4 comments
Assignees
Labels

Comments

@medAzizRezgui
Copy link

Describe the bug
I am used to write border-[1px] to get a 1 pixel border, I have eslint run on save and now it change it to border-DEFAULT which does not work, commenting out "plugin:tailwindcss/recommended" from eslint config, fixed the issue but I don't want to do that.

To Reproduce
Steps to reproduce the behavior:

  1. add a border-[1px] to a div and have eslint run on save.

Expected behavior
I expected border-DEFAULT to be a 1 pixel border.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Ubuntu 22.04 LTS
  • Softwares + version used:
    • VSCode 1.88.1
    • Eslint 8.57.0
    • Tailwindcss 3.4.3
    • eslint-plugin-tailwindcss 3.15.1

eslint config file or live demo

  "env": {
    "browser": true,
    "es2021": true
  },
  "extends": [
    "next/core-web-vitals",
    "plugin:react/recommended",
    "plugin:tailwindcss/recommended",
    "plugin:react-hooks/recommended"
    // "prettier"
  ],
  "parserOptions": {
    "semi": ["error", "always"],
    "ecmaVersion": "latest",
    "sourceType": "module"
  },
  "plugins": ["simple-import-sort"],
  "rules": {
    "semi": ["error", "always"],
    "no-console": "warn",
    "react/jsx-uses-react": "off",
    "react/react-in-jsx-scope": "off",
    "react/prop-types": "off",
    "simple-import-sort/imports": "error",
    "simple-import-sort/exports": "error",
    "import/newline-after-import": "error"
  }
}
@medAzizRezgui medAzizRezgui added the bug Something isn't working label Apr 21, 2024
@kachkaev
Copy link
Contributor

Likely duplicate of #326

@medAzizRezgui
Copy link
Author

medAzizRezgui commented Apr 21, 2024

Likely duplicate of #326

True, I am doing something like border-[1.01px] to get around it.

@kachkaev
Copy link
Contributor

You can replace border-DEFAULT with border and it’ll work for you. Alternatively, you can disable a specific rule ("tailwindcss/no-unnecessary-arbitrary-value": "off") rather than all recommended ones.

francoismassart added a commit that referenced this issue May 10, 2024
@francoismassart
Copy link
Owner

Hi @medAzizRezgui & @kachkaev,

In fact, the DEFAULT key should not be used, so:

border-[1px] should get replaced by border and NOT by border-DEFAULT

I made a fix which you can test via this beta version
npm i eslint-plugin-tailwindcss@3.15.3-beta.0

Let me know how it works for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants