Closed philippfromme closed 1 month ago
Passing the header as a string will result in the plugin treating it as a path to read from.
Doesn't work:
import licenseHeaderPlugin from 'eslint-plugin-license-header'; import apacheLicenseHeader from '../resources/apache-license-header.js' export default [ { plugins: { 'license-header': licenseHeaderPlugin }, rules: { 'license-header/header': [2, apacheLicenseHeader] } } ]
Works:
import licenseHeaderPlugin from 'eslint-plugin-license-header'; import apacheLicenseHeader from '../resources/apache-license-header.js' export default [ { plugins: { 'license-header': licenseHeaderPlugin }, rules: { 'license-header/header': [2, apacheLicenseHeader.split('\n')] } } ]
Passing header as string instead of array of strings works as to be expected from the name of the variable pathOrLicense.
pathOrLicense
To my knowledge this works, in according to the specification. What are you missing?
I guess it works as expected then. I just stumbled over the fact I have to .split('\n') my header,
.split('\n')
Describe the Bug
Passing the header as a string will result in the plugin treating it as a path to read from.
Steps to Reproduce
Doesn't work:
Works:
Expected Behavior
Passing header as string instead of array of strings works as to be expected from the name of the variable
pathOrLicense
.