Browse Source

add eslint-jest-plugin (#48)

* add eslint-jest-plugin

* also add envs
v5.0.0-beta
Keith Yao 8 years ago
committed by Eli Perelman
parent
commit
a2f671bb9e
  1. 1
      packages/neutrino-preset-jest/package.json
  2. 11
      packages/neutrino-preset-jest/src/index.js
  3. 4
      packages/neutrino-preset-jest/yarn.lock

1
packages/neutrino-preset-jest/package.json

@ -19,6 +19,7 @@
"babel-plugin-transform-es2015-modules-commonjs": "^6.22.0",
"babel-preset-jest": "^18.0.0",
"deepmerge": "^1.3.2",
"eslint-plugin-jest": "^19.0.1",
"jest-cli": "^18.1.0"
},
"homepage": "https://neutrino.js.org",

11
packages/neutrino-preset-jest/src/index.js

@ -65,6 +65,17 @@ module.exports = neutrino => {
};
});
if (neutrino.config.rules.has('lint')) {
neutrino.config.module
.rule('lint')
.loader('eslint', props => merge(props, {
options: {
plugins: ['jest'],
envs: ['jest']
}
}));
}
neutrino.on('test', args => {
const jest = normalizeJestConfig(neutrino, args);
const configFile = path.join(os.tmpdir(), 'config.json');

4
packages/neutrino-preset-jest/yarn.lock

@ -521,6 +521,10 @@ escodegen@^1.6.1:
optionalDependencies:
source-map "~0.2.0"
eslint-plugin-jest@^19.0.1:
version "19.0.1"
resolved "http://registry.npm.taobao.org/eslint-plugin-jest/download/eslint-plugin-jest-19.0.1.tgz#42a420e90e81aa74e162c16166e43a31b890eece"
esprima@^2.7.1:
version "2.7.3"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581"

Loading…
Cancel
Save