Skip to content

Output is truncated on MacOS (without --ci) #56

@janeklb

Description

@janeklb

Update: see further down for details on bug (output truncated on macos)


Original message:

Attempting to set this linter up for my project but running into the following error

$ ./node_modules/.bin/svglint  --debug src/assets/icons/*.svg
-------------------------------------------------------- Log --------------------------------------------------------
(x) (node:33848) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
(x) Failed to parse config: /Users/<redacted>/.svglintrc.js:1
export default {
^^^^^^

SyntaxError: Unexpected token 'export'
    at wrapSafe (internal/modules/cjs/loader.js:1001:16)
    at Module._compile (internal/modules/cjs/loader.js:1049:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:199:29)
    at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
    at async Loader.import (internal/modules/esm/loader.js:178:24)
    at async file:///Users/<redacted>/node_modules/svglint/bin/cli.js:65:28

I've got a .svglintrc.js file with the following:

export default {
  rules: {
    attr: {
      width: true,
      height: true,
    }
  }
}

Using node 14.18.1 on MacOS 12.1

Am I using it wrong?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions