super-linter: _LINTER_RULES rules doesn't exist
I’m also seeing issues when MARKDOWN_CONFIG_FILE is set, it is unable to find the file unless LINTER_RULES_PATH is also set.
Doesn’t work
- uses: github/super-linter@v3
env:
VALIDATE_MARKDOWN: true
MARKDOWN_CONFIG_FILE: docs/.markdownlint.yml
Works
- uses: github/super-linter@v3
env:
LINTER_RULES_PATH: '.' # From https://github.com/github/super-linter/pull/859#issuecomment-709625090
VALIDATE_MARKDOWN: true
MARKDOWN_CONFIG_FILE: docs/.markdownlint.yml
Not sure if it’s #854 or #859 but, if you provide, for example, JAVASCRIPT_ES_CONFIG_FILE it still tries to look for it in the DEFAULT_RULES_LOCATION when LINTER_RULES_PATH is not set (so i guess it ignores the default?). When you set LINTER_RULES_PATH it works fine.
_Originally posted by @PhunStyle in https://github.com/github/super-linter/pull/859#issuecomment-709625090_
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (4 by maintainers)
Commits related to this issue
- Added "Using your own rules files" to the README Added a "Using your own rules files" section to the README under the "Template rules" section. This section may help developers new to super-linter av... — committed to josephmarino/super-linter by josephmarino 4 years ago
- Added "Using your own rules files" to the README Added a "Using your own rules files" section to the README under the "Template rules" section. This section may help developers new to super-linter av... — committed to josephmarino/super-linter by josephmarino 4 years ago
- Added "Using your own rules files" to the README Added a "Using your own rules files" section to the README under the "Template rules" section. This section may help developers new to super-linter av... — committed to josephmarino/super-linter by josephmarino 4 years ago
- fix: set LINTER_RULES_PATH see https://github.com/github/super-linter/issues/864 — committed to influxdata/telegraf by deleted user 3 years ago
@gon1332 try adding
VALIDATE_JAVASCRIPT_ES: true, and also try replacingLINTER_RULES_PATH: ${{ github.workspace }}with the directory where your .eslintrc.json file is located. For example, if your .eslintrc.json file is located in your repo’s root directory, yourLINTER_RULES_PATHENV VAR should look likeLINTER_RULES_PATH: /notice that the forward slash is used to define the root directory.Also, take a look at: https://github.com/github/super-linter/blob/master/docs/using-rules-files.md to learn more about how to tell super-linter what your custom rule filenames are and where they are located.
Hopefully this helps. If not, please let us know.
@ferrarimarco @admiralAwkbar
What do you folks think about eliminating the
LINTER_RULES_PATHenv var, and replacing it with functionality that just searches the user’s repo for a config file if the user has set a config file env var in their super-linterlinter.yml?For example, if a user has set a config file env var in their linter.yml such as
MARKDOWN_CONFIG_FILE: .markdownlint.yml, super-linter could search the entire repo for.markdownlint.ymland then pass the path and file name to the markdown linter binary upon execution.This functionality would be similar to how cosmiconfig works. Some linters already have cosmiconfig functionality built in such as
stylelint. Folks may find it helpful if we were to apply this functionality to all linters in super-linter that support config file env vars such asstylelint,hadolint,markdownlint,eslint,pylint,robucupetc.Alternatively, updating the documentation is also a good idea. I’d be happy to contribute some text to the README to help with this issue 😄 if you folks would like me to.
@josephmarino It works now!! I had it all that done. I just needed a complete new Pull Request to have it to work. I kept committing on the test PR I opened days ago. Just learned it wasn’t the right way to test this change 😄
As a inexperienced Super-Linter user, documenting the use of how env vars are required to be used together would have likely made this a non-Issue.
However, without fully understanding the intended developer experience of Super-Linter, as a user I think I’d first expect this to work by setting only one env var and that a the base/root location would be based on my project and not the vendor specific workspace.
My opinion on that point is based on the fact that my workflow involves linting locally first, typically via an IDE, which expects configuration files placed in the root of project or root of the project’s specific directory (in my example case,
docs/formarkdownlint.yaml).Thank you for this tool!