markmcintyre / brackets-jslint

MIT License
6 stars 5 forks source link

Brackets hangs during JSLint scan of large file #3

Open jbmonroe opened 9 years ago

jbmonroe commented 9 years ago

I have a JS file that's an array of arrays used for games that need a dictionary. It's 1362KB in size, and upon loading it in Brackets, JSLint embarks on an epic journey to try to lint it.

Well, it doesn't need linting--just editing. Brackets hangs up like a jilted girlfriend during the lint, and it's entirely an issue with JSLint. (The current web version dies trying to parse it with a recursion failure.)

Not your fault, for sure, but still an issue. An option for the plug-in that disallowed linting any file larger than X KB would likely resolve this and still allow linting files of a more sane size. Any JS file larger than 100K probably needs to be broken down into smaller modules. Unfortunately for the dictionary, breaking it down into smaller files isn't really an option.

markmcintyre commented 9 years ago

An irritation, for sure. I wonder if the new version of Crockford's JSLint will resolve this issue? If not, I can look into including an option to disable linting on files. I'll likely update this plugin once the new JSLint version is released.

jbmonroe commented 9 years ago

There may well be a Brackets config that gets around it. I (think I) was using the new JSLint when I discovered the crash--the UI was new, anyway.

I'm thinking the pro tip here is "you don't need to lint a large file that's just an array, so just edit it with Sublime Text." I should use this as a cue to just JSON/P the whole mess over in smaller units.

On 5/24/2015 1:30 PM, Mark McIntyre wrote:

An irritation, for sure. I wonder if the new version of Crockford's JSLint will resolve this issue? If not, I can look into including an option to disable linting on files. I'll likely update this plugin once the new JSLint version is released.

— Reply to this email directly or view it on GitHub https://github.com/markmcintyre/brackets-jslint/issues/3#issuecomment-105041165.

TomMalbran commented 9 years ago

@jbmonroe You can disable linting for that file in the .brackets.json file with something like:

    "path": {
        "path/to/file.js": {
            "linting.enabled": false
        }
    }