question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom Linter .lesshint file require throws error

See original GitHub issue

Which version of lesshint are you using?

2.4.0

How are you running lesshint? CLI, Node.js API, Grunt/Gulp plugin?

CLI

What’s your .lesshintrc configuration?

{
  "linters": [
      require("./linters/custom-linter")
  ],
  "singleLinePerSelector": false,
  "propertyOrdering": false,
  "importantRule": false,
  "zeroUnit": false,
  "decimalZero": false,
  "newlineAfterBlock": false,
  "hexNotation": false,
  "qualifyingElement": false,
  "spaceBeforeBrace": {
     "style": "one_space"
  },
  "singleLinePerProperty": true,
  "hexLength": false,
  "spaceAroundOperator": false,
  "attributeQuotes": false,
  "stringQuotes": false,
  "finalNewline": false,
  "idSelector": false,
  "borderZero": false,
  "maxCharPerLine": false,
  "emptyRule": true,
  "trailingSemicolon": true,
  "spaceAfterPropertyColon": {
    "style": "one_space"
  }
}

If you’re reporting a bug, please show us some code that’s failing.

 "linters": [
      require("./linters/custom-linter")
  ],

What did you expect to happen?

Run the custom linter

What’s the actual result?

Something’s wrong with the config file. Error: Unexpected token r

Would you be interested in submitting a PR for this issue?

Didn’t manage to diving into lesshint code

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
shellscapecommented, Jan 26, 2017

They just merged a PR today to assist with that https://github.com/lesshint/lesshint/pull/328

1reaction
shellscapecommented, Jan 26, 2017

(updated; please use backticks for code)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to tell my linter to flag require() statements with a warning
I ran yarn add eslint -D and npx eslint --init to set up eslint . Then I changed the rules: object in my...
Read more >
LessHint - GitHub
A globby glob pattern or a file to exclude from being linted. -l / --linters, Paths to custom linters to add to the...
Read more >
Custom Linters - What is Trunk?
Every custom linter must specify a name, the types of files it will run on, ... If there are multiple non-empty captures, a...
Read more >
Customizing Your Super-Linter and ESLint JavaScript Rules
In this post, we will look at how to customize the rules. ... This tells the linter to use a config file in...
Read more >
How to write a custom ESLint rule - Scott Logic Blog
Always wanted to write a custom linting rule for your JavaScript ... This guide will introduce the key concepts you need to give...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found