daisyui icon indicating copy to clipboard operation
daisyui copied to clipboard

DaisyUI together with eslint-plugin-tailwind and Trunk fails

Open nonameolsson opened this issue 3 years ago • 1 comments

When I use Eslint with Trunk.io together with DaisyUI the linting fails. I am not sure if the error comes from DaisyUI or from eslint-plugin-tailwindcss. https://github.com/francoismassart/eslint-plugin-tailwindcss/issues/150

Demo: https://user-images.githubusercontent.com/1493018/177493802-1d98d00c-674c-486c-a133-ce35a25de57d.mp4

Error log

title: Internal trunk error occurred. Please report this issue to us @ https://slack.trunk.io
report:
  - "[json.exception.parse_error.101] parse error at line 2, column 1: syntax error while parsing value - invalid literal; last read: '<U+000A><U+001B>'"
  - command: |
      /home/gitpod/.cache/trunk/linters/eslint/8.18.0-58b2f22762742f682f5e0f5be5812ef5/node_modules/.bin/eslint --format json prisma/seed.ts
    stdin_path: (none)
    run_from: /workspace/linjen
    timeout: 10m
    rerun: env -i -C /workspace/linjen HOME=/home/gitpod PATH=/home/gitpod/.cache/trunk/linters/eslint/8.18.0-58b2f22762742f682f5e0f5be5812ef5/node_modules/.bin:/home/gitpod/.cache/trunk/linters/node/16.14.2-793f8dc0dd107c4610e5685da6d88dbf/bin /home/gitpod/.cache/trunk/linters/eslint/8.18.0-58b2f22762742f682f5e0f5be5812ef5/node_modules/.bin/eslint --format json prisma/seed.ts
    exit_status: exited
    exit_code: 0
    stdout: |

      [35m🌼 daisyUI components 2.18.0[0m [0m https://github.com/saadeghi/daisyui
        [32m✔︎ Including:[0m [0m base, components, themes[29], utilities
        
      [{"filePath":"/workspace/linjen/prisma/seed.ts","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]}]

    stderr: (none)

nonameolsson avatar Jul 06 '22 07:07 nonameolsson

A little more info:

The output of eslint with eslint-plugin-tailwindcss when using --format json is:

      [35m🌼 daisyUI components 2.17.0[0m [0m https://github.com/saadeghi/daisyui
        [32m✔︎ Including:[0m [0m base, components, themes[29], utilities
        

      [35m🌼 daisyUI components 2.17.0[0m [0m https://github.com/saadeghi/daisyui
        [32m✔︎ Including:[0m [0m base, components, themes[29], utilities
        
      [{"filePath":"/workspace/linjen/app/components/navbar.tsx","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/workspace/linjen/app/components/page.tsx","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/workspace/linjen/app/routes/timeline/$timelineId.tsx","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]}]

Note that the daisyUI lines are not json. It shouldn't print not-json when using --format json

dapirian avatar Jul 06 '22 15:07 dapirian

Looks like it is fixed on eslint-plugin-tailwindcss

saadeghi avatar May 29 '23 01:05 saadeghi