eslint: Fix invalid filename validation
Attempt to fix the following error which is appearing in every new MR since eslint-plugin-filenames was introduced.
/builds/gitlab-org/gitlab-ce/app/assets/javascripts/gl_field_error.js.es6
2:1 error Filename 'gl_field_error.js.es6' does not match the naming convention filenames/match-regex
This was happening because our ES6 files have the following structure gl_hello_world.js.es6. So eslint-plugin-filenames was considering as base name gl_hello_world.js which didn't pass the previous regex ^[a-z_]+$
This new regex allows the following filenames to pass as valid:
-
gl_hello_world.js.es6which base name translates togl_hello_world.js -
gl_foo_bar.jswhich base name translates togl_foo_bar -
d3.jswhich base name translates tod3(especial case, maybe we should move this to the vendor dir and make the regex more specific)