less / less/less-docs

Compilation errors

Open
#179 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Less
Stars
680
Forks
442
PR merge metrics
No merged PRs in 30d

Description

I think (or can't find) any documentation about Compilation errors is missing. Maybe you can use the code found below. This section can be add just before the "License FAQs" section. I found i can't write a PR due the section is written in /templates/index.hbs instead of in a .md file.

Suggestion:

The less.js throws errors on different types of errors. Possible error types are: ParseError, SyntaxError, NameError and FileError.

The ParseError errors will be thrown when your code is invalid. For instance a missing {or ; trigger this error.
The SyntaxError errors can be found when declaring a property outside a selector block. The following code will thrown SyntaxError: properties must be inside selector blocks, they cannot be in the root. due to the color: red not wrapped:

selector { color: green; }
color: red;

Referencing to undefined mixins and variable will give a NameError error. For a undefined mixin you can find NameError: .mixin is undefined and for a undefined variable an error that like NameError: variable @color is undefined.

Also endless loops as in the following code, will trown a SyntaxError: Maximum call stack size exceeded error:

.mixin(){
.mixin;
}
selector {
.mixin;
}

Trying to import not exitsting files with the @import directives will thrown a FileError: 'filename.less' wasn't found error.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open /templates/index.hbs and locate the "License FAQs" section. Add the proposed Compilation errors documentation immediately before it, covering the error types and examples described in the issue. Done means the new section is present in the generated documentation with the suggested explanations and code samples.

Written by the indexing model from the issue text.

Assessment

Tech stack
handlebars
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.