I'm trying to ignore import statements with the ESLint "max-len" rule and some ES6 code. My rule set is written in a config in index.js
and the config for the rule itself looks like this:
'max-len': [
2,
80,
4,
{
ignoreUrls: true,
ignorePattern: /^import\s.+\sfrom\s.+;$/
}
],
Lines exceeding 80 characters still trigger errors given the RegExp I've provided. Is there something I'm not understanding about the rule itself?
I've also tried simpler RegExps and passing RegExp strings such as:
'^import.*'
Found here: http://eslint.org/docs/rules/max-len
$
? It's not obvious if the line contains trailing\n
or\r
or not.ignorePattern: "^import\\s.+\\sfrom\\s.+;$"
/^import*/
, it still failsignorePattern = new RegExp(ignorePattern);
so it can be either.