-
-
Notifications
You must be signed in to change notification settings - Fork 65
Add awesome/code-of-conduct rule
#76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@sindresorhus Sure. I just want to confirm my PR didn't break too much things. Now you can start to review detailed codes. Thanks. |
lib/find-author-name.js
Outdated
| const pkgJsonFile = path.resolve(dirname, 'package.json'); | ||
| if (fs.existsSync(pkgJsonFile)) { | ||
| const json = require(pkgJsonFile); | ||
| if (json && json.repository) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are making assumption about the format of repository that are not always true. repository can have many different formats.
You're also making assumption that the package.json is in the same directory as the readme.
Use https://github.com/sindresorhus/read-pkg-up to have the data normalized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion. But I chose read-pkg instead of read-pkg-up.
This project has made the assumption that readme file is in the root directory of the project. So don't searching package.json in parent directories, and that will make writing test hard. Because read-pkg-up may find the package.json of awesome-lint itself and result in some misleadings.
Co-Authored-By: Sindre Sorhus <[email protected]>
Co-Authored-By: Sindre Sorhus <[email protected]>
Co-Authored-By: Sindre Sorhus <[email protected]>
Co-Authored-By: Itai Steinherz <[email protected]>
awesome/code-of-conduct rule
Close #58.
Before merging, let's discuss something.
awesomeLint(), has been changed fromPromise<VFile>toPromise<VFile[]>. Although I have updated docs. Is it acceptable or are there better solutions?awesomeLint.report(options)didn't mentionoptions.config. Is it a public option or private? My current implementation follows original codes to use it to config rules for readme file, but users have no way to config rules for code-of-conduct file now.repoURLin this case. I didn't find a good way except for adding it to the VFile object.