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

Error using customFunctions of Less #37

Open
felquis opened this issue Jun 15, 2014 · 2 comments
Open

Error using customFunctions of Less #37

felquis opened this issue Jun 15, 2014 · 2 comments

Comments

@felquis
Copy link

felquis commented Jun 15, 2014

Olá.

I have an error here, and I think that grunt-lesslint is not using the customFunctions config of grunt-contrib-less. Take a look in the context of my project bellow... here is my source

This is the error:

Running "lesslint:src" (lesslint) task
Error parsing less/main.less: Cannot read property 'numerator' of undefined

Here is my project...

I'm using grunt-contrib-less to build my less files, and this is my config:

    less: {
      options: {
        customFunctions: lessFunctions
      },
      development: {
        files: {
          "css/main.css": "less/main.less"
        }
      }
    }

The var lessFunctions is this object:

{
  indexof: function (less, value, array) {
    return new less.tree.Dimension(array.value.indexOf(value));
  }
}

I'm using this indexof function in line 38 of this file

@letterIndex: indexof(@letter, @squareLetters);

This is the config of lesslist task:

    lesslint: {
      src: ['less/main.less']
    }

I tried to use this config

    lesslint: {
      src: ['less/main.less'],
      options: {
        less: {
          functions: lessFunctions
        }
      }
    }

But, just doesn`t work :/

So.. i hope that I was clear. Somebody can help me?

I tried to hack the task`s source, but I'm not good in CoffeScript

@jgable
Copy link
Owner

jgable commented Jun 16, 2014

We don't currently support customFunctions. I think it's worth adding, but I'm going to be busy this week.

I'd take a PR for it if you want to give a shot at the CoffeeScript.

Thanks for bringing it up.

@felquis
Copy link
Author

felquis commented Jun 16, 2014

Thanks for the feedback @jgable

I'll check this week if I can understand the source to use the customFunctions.

See you 😄

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

No branches or pull requests

2 participants