-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Integrate eslint & precommit to codebase #815
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"extends": ["fbjs", "prettier"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we adding more of them later? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think not so soon. fbjs config is quite ok for now. We can always overrides their rules later on |
||
"rules": { | ||
"no-console": 0, | ||
"radix": 0, | ||
"no-unused-vars": 2 | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": [ "examples/**/*.js" ], | ||
"rules": { | ||
"no-unused-vars": 0 | ||
} | ||
} | ||
] | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add newline. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
node_modules | ||
|
||
.eslintcache | ||
lib/core/metadata.js | ||
lib/core/MetadataBlog.js | ||
lib/pages/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,9 +56,9 @@ beforeAll(() => { | |
}); | ||
}); | ||
|
||
function afterAll() { | ||
afterAll(() => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This changes the meaning - It was declaring a function before, now it's executing it. The after version looks more correct though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup. it's actually caught by the linter. Otherwise the function is never used |
||
clearBuildFolder(); | ||
} | ||
}); | ||
|
||
test('Build folder exists', function() { | ||
return fs.stat(buildDir).then(function(status) { | ||
|
@@ -73,7 +73,6 @@ test('Generated HTML for each Markdown resource', function() { | |
metadata.push(path.basename()); | ||
}); | ||
inputMarkdownFiles.forEach(function(file) { | ||
const path = filepath.create(file); | ||
const data = fs.readFileSync(file, 'utf8'); | ||
const frontmatter = fm(data); | ||
expect(metadata).toContain(frontmatter.attributes.id + '.html'); | ||
|
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.
Let's use
.js
extension. It's much more flexible than JSON and we can add comments.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.
ok