-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat(eslint): enable jest rules #29
Conversation
The jest rules are added in test.js, so this patch should target that file. |
Ah, I see. Ok, I'll fix this. |
This rule conflicts with co-located tests. A test.js file should be allowed to import from '/index'
I just pushed a fix for a rule I noticed was conflicting with co-located tests. |
__tests__/package.spec.js
Outdated
@@ -12,6 +12,8 @@ | |||
* the License. | |||
*/ | |||
|
|||
/* eslint-disable jest/no-test-callback */ |
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.
well that's embarrassing
might be better to
const path = require('path');
const util = require('util');
const exec = util.promisify(require('child_process').exec);
const packageJson = require('../package.json');
describe('package.json', () => {
it('should not have peer dep warnings', async () => {
expect.assertions(2);
// ex:
// npm ERR! peer dep missing: eslint@<2.3.0, required by babel-eslint@5.0.4
const { stdout, stderr } = exec('npm ls', { cwd: path.resolve(__dirname, '../') });
// if there are no complaints from npm, stdout is null
expect(stdout || '').not.toMatch('peer dep missing');
expect(stderr || '').not.toMatch('peer dep missing');
});
than disabling rules in our own repository/project?
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.
It's not my code and I didn't immediately know how to make it compliant, so I disabled the rule as a quick solution. If you know how to fix it, please do.
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.
Fixed
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.
prettier also changed the license headers, left suggestions to revert, hoping that makes it easy to fix and merge quickly 🤞
I think these were intended to be active but were overlooked? If that's the case, @10xLaCroixDrinker do you think this might be a fix? Adding breaking rules might be a major version feature? 🤔 |
Arent we bundling all these PRs into a major release anyway? |
# [13.0.0](v12.2.0...v13.0.0) (2020-07-16) ### Bug Fixes * **eslint:** disable prevent abbreviations ([#33](#33)) ([6647bef](6647bef)) ### Features * **eslint:** configuration ([#30](#30)) ([6229d4a](6229d4a)) * **eslint:** disable function scoping ([#35](#35)) ([0a0c5bb](0a0c5bb)) * **eslint:** disable prefer default export ([#26](#26)) ([45b88d3](45b88d3)) * **eslint:** enable jest rules ([#29](#29)) ([846bbf7](846bbf7)) * **eslint:** react/jsx quality of life rules ([#24](#24)) ([facff92](facff92)) * **js:** additional js rules ([58df834](58df834)) * **prettier:** add ([#45](#45)) ([00cecaf](00cecaf)) * **unicorn:** update and seperate rules ([#43](#43)) ([940eb66](940eb66)) * **unicorn/consistent-function-scoping:** disable ([#42](#42)) ([54dd5a3](54dd5a3)) ### BREAKING CHANGES * **unicorn:** major update to unicorn * **js:** no-lonely-if errors * **js:** no-return-assign, errors * **js:** prefer-object-spread, errors * **js:** no-bitwise, errors
Enable jest eslint rules. The plugin was installed but it wasn't being used.