p5.accessibility icon indicating copy to clipboard operation
p5.accessibility copied to clipboard

grunt curl 's colorNamer.js has lint errors

Open mithru opened this issue 6 years ago • 7 comments

Nature of issue?

  • [x] Found a bug
  • [ ] Existing feature enhancement
  • [ ] New feature request

Details about the bug:

  • Web browser and version:
  • Operating System:
  • Steps to reproduce this:

Following this step in the readme generates a new colorNamer.js with indents that eslint doesn't like. run grunt curl to get the latest versions of the CDN libraries

Feature enhancement details:

New feature details:

mithru avatar Aug 09 '18 05:08 mithru

@mithru I am not seeing the same issue. Maybe it is your text editor settings? Either way, does running eslint src/ --fix work for you? Do you think i should add --fix in to the build script?

spiray avatar Aug 09 '18 14:08 spiray

I can fix in the color library.

lm-n avatar Aug 09 '18 23:08 lm-n

Tried eslint src/ --fix on a borrowed machine and this happens (I see the same lint errors in colorNamer.js - I was using vim in both scenarios which defaults to 4-spaced tabs instead of a single space):

Error: Cannot find module 'eslint-config-p5js'

npm install --save-dev eslint-config-p5js doesn't seem to help either. I'm definitely missing something on both machines (Windows and Mac). Any ideas? Help, please.

mithru avatar Aug 22 '18 09:08 mithru

@mithru I am not having this issue. Did you run npm install? If so, can you try it in another editor to see if it is being caused by VIM's behavior?

spiray avatar Aug 22 '18 15:08 spiray

@mithru I've updated the colornamer could you try and let me know if there are no linting errors?

lm-n avatar Sep 23 '18 16:09 lm-n

@lm-n

The lint setup on p5 accessibility library still complains about spaces, but I think @spiray 's method of adding --fix to the build script might be the way to handle this, since color namer doesn't necessarily have to abide by eslint-config-p5js

In any case, here's what npm run build throws at me. eslint src/ --fix fixes these indent issues.

eslint-config-p5js and eslint are installed globally on my machine though. I have not tried having both just local.

    2:1   error  Expected indentation of 2 spaces but found 4    indent
    3:1   error  Expected indentation of 2 spaces but found 4    indent

mithru avatar Sep 27 '18 14:09 mithru

changing the colorNamer to es6 definitely helped.

mithru avatar Sep 27 '18 14:09 mithru