Socket
Socket
Sign inDemoInstall

eslint-plugin-jest

Package Overview
Dependencies
Maintainers
10
Versions
325
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-jest - npm Package Compare versions

Comparing version 23.20.0 to 24.0.0

docs/rules/no-done-callback.md

40

CHANGELOG.md

@@ -0,1 +1,41 @@

# [24.0.0](https://github.com/jest-community/eslint-plugin-jest/compare/v23.20.0...v24.0.0) (2020-09-04)
### Bug Fixes
* **no-large-snapshots:** run on all files regardless of type ([#637](https://github.com/jest-community/eslint-plugin-jest/issues/637)) ([22113db](https://github.com/jest-community/eslint-plugin-jest/commit/22113db4cdc2dab42a8e7fdb236d23e7e089741d)), closes [#370](https://github.com/jest-community/eslint-plugin-jest/issues/370)
* remove Jasmine globals ([#596](https://github.com/jest-community/eslint-plugin-jest/issues/596)) ([a0e2bc5](https://github.com/jest-community/eslint-plugin-jest/commit/a0e2bc526c5c22bcf4d60160242b55d03edb571d))
* update to typescript-eslint@4 ([1755965](https://github.com/jest-community/eslint-plugin-jest/commit/175596582b3643f36363ff444f987fac08ee0f61)), closes [#590](https://github.com/jest-community/eslint-plugin-jest/issues/590)
### Code Refactoring
* **no-test-callback:** rename rule to `no-done-callback` ([#653](https://github.com/jest-community/eslint-plugin-jest/issues/653)) ([e15a8d1](https://github.com/jest-community/eslint-plugin-jest/commit/e15a8d19234b267784f87fc7acd318dc4cfcdeae))
### Features
* **no-done-callback:** support hooks ([#656](https://github.com/jest-community/eslint-plugin-jest/issues/656)) ([3e6cb44](https://github.com/jest-community/eslint-plugin-jest/commit/3e6cb442a20b9aea710d30f81bf2eb192d193823)), closes [#649](https://github.com/jest-community/eslint-plugin-jest/issues/649) [#651](https://github.com/jest-community/eslint-plugin-jest/issues/651)
* add `no-conditional-expect` to the recommended ruleset ([40cd89d](https://github.com/jest-community/eslint-plugin-jest/commit/40cd89ddf1d6ebbde8ad455f333dda7b61878ffe))
* add `no-deprecated-functions` to the recommended ruleset ([5b2af00](https://github.com/jest-community/eslint-plugin-jest/commit/5b2af001b50059e4e7b6ababe0355d664e039046))
* add `no-interpolation-in-snapshots` to the recommended ruleset ([3705dff](https://github.com/jest-community/eslint-plugin-jest/commit/3705dff9d4f77d21013e263478d8a374d9325acb))
* add `valid-title` to recommended ruleset ([41f7873](https://github.com/jest-community/eslint-plugin-jest/commit/41f7873f734e0122264ace42f6d99733e7e25089))
* drop support for node 8 ([#570](https://github.com/jest-community/eslint-plugin-jest/issues/570)) ([6788e72](https://github.com/jest-community/eslint-plugin-jest/commit/6788e72d842751400a970e72b115360ad0b12d2e))
* set `no-jasmine-globals` to `error` in recommended ruleset ([7080952](https://github.com/jest-community/eslint-plugin-jest/commit/7080952a6baaae7a02c78f60016ee21693121416))
* **no-large-snapshots:** remove `whitelistedSnapshots` option ([8c1c0c9](https://github.com/jest-community/eslint-plugin-jest/commit/8c1c0c9a3e858757b38225ccb4a624e0621b5ca2))
### BREAKING CHANGES
* **no-done-callback:** `no-done-callback` will now report hooks using callbacks as well, not just tests
* **no-test-callback:** rename `no-test-callback` to `no-done-callback`
* recommend `no-conditional-expect` rule
* recommend `no-interpolation-in-snapshots` rule
* recommend `no-deprecated-functions` rule
* recommend `valid-title` rule
* recommend erroring for `no-jasmine-globals` rule
* **no-large-snapshots:** `no-large-snapshots` runs on all files regardless of type
* Jasmine globals are no marked as such
* Node 10+ required
# [23.20.0](https://github.com/jest-community/eslint-plugin-jest/compare/v23.19.0...v23.20.0) (2020-07-30)

@@ -2,0 +42,0 @@

8

docs/rules/consistent-test-it.md

@@ -62,3 +62,3 @@ # Have control over `test` and `it` usages (`consistent-test-it`)

it('foo'); // valid
describe('foo', function() {
describe('foo', function () {
test('bar'); // valid

@@ -68,3 +68,3 @@ });

test('foo'); // invalid
describe('foo', function() {
describe('foo', function () {
it('bar'); // invalid

@@ -83,3 +83,3 @@ });

test('foo'); // valid
describe('foo', function() {
describe('foo', function () {
it('bar'); // valid

@@ -89,5 +89,5 @@ });

it('foo'); // invalid
describe('foo', function() {
describe('foo', function () {
test('bar'); // invalid
});
```

@@ -59,5 +59,3 @@ # Enforce assertion to be made in a test body (`expect-expect`)

test('returns sum', () => {
expectSaga(addSaga, 1, 1)
.returns(2)
.run();
expectSaga(addSaga, 1, 1).returns(2).run();
});

@@ -76,5 +74,3 @@ ```

test('returns sum', () => {
expectSaga(addSaga, 1, 1)
.returns(2)
.run();
expectSaga(addSaga, 1, 1).returns(2).run();
});

@@ -105,10 +101,7 @@ ```

describe('GET /user', function() {
it('responds with json', function(done) {
request(app)
.get('/user')
.expect('Content-Type', /json/)
.expect(200, done);
describe('GET /user', function () {
it('responds with json', function (done) {
request(app).get('/user').expect('Content-Type', /json/).expect(200, done);
});
});
```

@@ -18,3 +18,3 @@ # Disallow using `exports` in files containing tests (`no-export`)

module.exports = function() {};
module.exports = function () {};

@@ -21,0 +21,0 @@ module.exports = {

@@ -18,3 +18,3 @@ # Disallow explicitly returning from tests (`no-test-return-statement`)

it('noop', function() {});
it('noop', function () {});

@@ -31,3 +31,3 @@ test('noop', () => {});

it('one', function() {
it('one', function () {
expect(1).toBe(1);

@@ -46,5 +46,5 @@ });

it('returning a promise', function() {
it('returning a promise', function () {
return new Promise(res => setTimeout(res, 100)).then(() => expect(1).toBe(1));
});
```

@@ -58,3 +58,3 @@ # Enforce valid titles (`valid-title`)

xdescribe(myFunction, () => {});
describe(6, function() {});
describe(6, function () {});
```

@@ -86,3 +86,3 @@

xdescribe(myFunction, () => {});
describe(6, function() {});
describe(6, function () {});
```

@@ -89,0 +89,0 @@

@@ -8,10 +8,5 @@ {

"expect": false,
"fail": false,
"fit": false,
"it": false,
"jasmine": false,
"jest": false,
"pending": false,
"pit": false,
"require": false,
"test": false,

@@ -18,0 +13,0 @@ "xdescribe": false,

@@ -17,8 +17,2 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
// copied from https://github.com/babel/babel/blob/d8da63c929f2d28c401571e2a43166678c555bc4/packages/babel-helpers/src/helpers.js#L602-L606

@@ -36,9 +30,9 @@

const excludedFiles = ['__tests__', 'utils'];
const rules = (0, _fs.readdirSync)(rulesDir).map(rule => (0, _path.parse)(rule).name).filter(rule => !excludedFiles.includes(rule)).reduce((acc, curr) => _objectSpread(_objectSpread({}, acc), {}, {
const rules = (0, _fs.readdirSync)(rulesDir).map(rule => (0, _path.parse)(rule).name).filter(rule => !excludedFiles.includes(rule)).reduce((acc, curr) => ({ ...acc,
[curr]: importDefault((0, _path.join)(rulesDir, curr))
}), {});
const recommendedRules = Object.entries(rules).filter(([, rule]) => rule.meta.docs.recommended).reduce((acc, [name, rule]) => _objectSpread(_objectSpread({}, acc), {}, {
const recommendedRules = Object.entries(rules).filter(([, rule]) => rule.meta.docs.recommended).reduce((acc, [name, rule]) => ({ ...acc,
[`jest/${name}`]: rule.meta.docs.recommended
}), {});
const allRules = Object.keys(rules).reduce((rules, key) => _objectSpread(_objectSpread({}, rules), {}, {
const allRules = Object.keys(rules).reduce((rules, key) => ({ ...rules,
[`jest/${key}`]: 'error'

@@ -45,0 +39,0 @@ }), {});

@@ -16,3 +16,3 @@ "use strict";

category: 'Best Practices',
recommended: false
recommended: 'error'
},

@@ -19,0 +19,0 @@ messages: {

@@ -12,8 +12,2 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
let cachedJestVersion = null;

@@ -43,3 +37,3 @@ /** @internal */

}
} catch (_unused) {}
} catch {}

@@ -55,3 +49,3 @@ throw new Error('Unable to detect Jest version - please ensure jest package is installed, or otherwise set version explicitly');

description: 'Disallow use of deprecated functions',
recommended: false
recommended: 'error'
},

@@ -68,19 +62,22 @@ messages: {

create(context) {
var _ref, _ref$jest;
var _context$settings, _context$settings$jes;
const jestVersion = ((_ref = context.settings) === null || _ref === void 0 ? void 0 : (_ref$jest = _ref.jest) === null || _ref$jest === void 0 ? void 0 : _ref$jest.version) || detectJestVersion();
const deprecations = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, jestVersion >= 15 && {
'jest.resetModuleRegistry': 'jest.resetModules'
}), jestVersion >= 17 && {
'jest.addMatchers': 'expect.extend'
}), jestVersion >= 21 && {
'require.requireMock': 'jest.requireMock',
'require.requireActual': 'jest.requireActual'
}), jestVersion >= 22 && {
'jest.runTimersToTime': 'jest.advanceTimersByTime'
}), jestVersion >= 26 && {
'jest.genMockFromModule': 'jest.createMockFromModule'
});
const jestVersion = ((_context$settings = context.settings) === null || _context$settings === void 0 ? void 0 : (_context$settings$jes = _context$settings.jest) === null || _context$settings$jes === void 0 ? void 0 : _context$settings$jes.version) || detectJestVersion();
const deprecations = { ...(jestVersion >= 15 && {
'jest.resetModuleRegistry': 'jest.resetModules'
}),
...(jestVersion >= 17 && {
'jest.addMatchers': 'expect.extend'
}),
...(jestVersion >= 21 && {
'require.requireMock': 'jest.requireMock',
'require.requireActual': 'jest.requireActual'
}),
...(jestVersion >= 22 && {
'jest.runTimersToTime': 'jest.advanceTimersByTime'
}),
...(jestVersion >= 26 && {
'jest.genMockFromModule': 'jest.createMockFromModule'
})
};
return {

@@ -111,3 +108,2 @@ CallExpression(node) {

fix(fixer) {
// eslint-disable-next-line prefer-const
let [name, func] = replacement.split('.');

@@ -114,0 +110,0 @@

@@ -17,3 +17,3 @@ "use strict";

const matchesTestFunction = object => 'name' in object && (object.name in _utils.TestCaseName || object.name in _utils.DescribeAlias);
const matchesTestFunction = object => 'name' in object && typeof object.name === 'string' && (object.name in _utils.TestCaseName || object.name in _utils.DescribeAlias);

@@ -20,0 +20,0 @@ const isCallToFocusedTestFunction = object => object.name.startsWith('f') && testFunctions.has(object.name.substring(1));

@@ -18,3 +18,3 @@ "use strict";

description: 'Disallow string interpolation inside snapshots',
recommended: false
recommended: 'error'
},

@@ -21,0 +21,0 @@ messages: {

@@ -18,3 +18,3 @@ "use strict";

description: 'Disallow Jasmine globals',
recommended: 'warn'
recommended: 'error'
},

@@ -21,0 +21,0 @@ messages: {

@@ -14,12 +14,5 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
const reportOnViolation = (context, node, {
maxSize: lineLimit = 50,
whitelistedSnapshots = {},
allowedSnapshots = whitelistedSnapshots
allowedSnapshots = {}
}) => {

@@ -92,10 +85,2 @@ const startLine = node.loc.start.line;

}
},
whitelistedSnapshots: {
type: 'object',
patternProperties: {
'.*': {
type: 'array'
}
}
}

@@ -109,6 +94,2 @@ },

create(context, [options]) {
if ('whitelistedSnapshots' in options) {
console.warn('jest/no-large-snapshots: the "whitelistedSnapshots" option has been renamed to "allowedSnapshots"');
}
if (context.getFilename().endsWith('.snap')) {

@@ -121,18 +102,30 @@ return {

};
} else if (context.getFilename().endsWith('.js')) {
return {
CallExpression(node) {
if ('property' in node.callee && ((0, _utils.isSupportedAccessor)(node.callee.property, 'toMatchInlineSnapshot') || (0, _utils.isSupportedAccessor)(node.callee.property, 'toThrowErrorMatchingInlineSnapshot'))) {
var _options$inlineMaxSiz;
}
reportOnViolation(context, node, _objectSpread(_objectSpread({}, options), {}, {
maxSize: (_options$inlineMaxSiz = options.inlineMaxSize) !== null && _options$inlineMaxSiz !== void 0 ? _options$inlineMaxSiz : options.maxSize
}));
}
return {
CallExpression(node) {
var _matcher$node$parent;
if (!(0, _utils.isExpectCall)(node)) {
return;
}
};
}
const {
matcher
} = (0, _utils.parseExpectCall)(node);
return {};
if ((matcher === null || matcher === void 0 ? void 0 : (_matcher$node$parent = matcher.node.parent) === null || _matcher$node$parent === void 0 ? void 0 : _matcher$node$parent.type) !== _experimentalUtils.AST_NODE_TYPES.CallExpression) {
return;
}
if (['toMatchInlineSnapshot', 'toThrowErrorMatchingInlineSnapshot'].includes(matcher.name)) {
var _options$inlineMaxSiz;
reportOnViolation(context, matcher.node.parent, { ...options,
maxSize: (_options$inlineMaxSiz = options.inlineMaxSize) !== null && _options$inlineMaxSiz !== void 0 ? _options$inlineMaxSiz : options.maxSize
});
}
}
};
}

@@ -139,0 +132,0 @@

@@ -15,3 +15,3 @@ "use strict";

if (secondArg && (0, _utils.isFunction)(secondArg) && secondArg.body && secondArg.body.type === _experimentalUtils.AST_NODE_TYPES.BlockStatement) {
if (secondArg && (0, _utils.isFunction)(secondArg) && secondArg.body.type === _experimentalUtils.AST_NODE_TYPES.BlockStatement) {
return secondArg.body.body;

@@ -18,0 +18,0 @@ }

@@ -43,3 +43,3 @@ "use strict";

if (!matcher || !(0, _utils.isParsedEqualityMatcherCall)(matcher) || !argument || argument.type !== _experimentalUtils.AST_NODE_TYPES.MemberExpression || !(0, _utils.isSupportedAccessor)(argument.property, 'length') || argument.property.type !== _experimentalUtils.AST_NODE_TYPES.Identifier) {
if (!matcher || !(0, _utils.isParsedEqualityMatcherCall)(matcher) || (argument === null || argument === void 0 ? void 0 : argument.type) !== _experimentalUtils.AST_NODE_TYPES.MemberExpression || !(0, _utils.isSupportedAccessor)(argument.property, 'length') || argument.property.type !== _experimentalUtils.AST_NODE_TYPES.Identifier) {
return;

@@ -46,0 +46,0 @@ }

@@ -16,10 +16,4 @@ "use strict";

}
/* istanbul ignore if https://github.com/typescript-eslint/typescript-eslint/issues/734 */
if (!node.body) {
throw new Error(`Unexpected null while performing prefer-todo - please file a github issue at https://github.com/jest-community/eslint-plugin-jest`);
}
return node.body.type === _experimentalUtils.AST_NODE_TYPES.BlockStatement && node.body.body && !node.body.body.length;
return node.body.type === _experimentalUtils.AST_NODE_TYPES.BlockStatement && !node.body.body.length;
}

@@ -26,0 +20,0 @@

@@ -29,2 +29,4 @@ "use strict";

CallExpression(node) {
var _matcher$arguments;
if (!(0, _utils.isExpectCall)(node)) {

@@ -39,3 +41,3 @@ return;

if (matcher && matcher.arguments && matcher.arguments.length === 0 && ['toThrow', 'toThrowError'].includes(matcher.name) && (!modifier || !(modifier.name === _utils.ModifierName.not || modifier.negation))) {
if ((matcher === null || matcher === void 0 ? void 0 : (_matcher$arguments = matcher.arguments) === null || _matcher$arguments === void 0 ? void 0 : _matcher$arguments.length) === 0 && ['toThrow', 'toThrowError'].includes(matcher.name) && (!modifier || !(modifier.name === _utils.ModifierName.not || modifier.negation))) {
// Look for `toThrow` calls with no arguments.

@@ -42,0 +44,0 @@ context.report({

@@ -15,8 +15,2 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
const REPO_URL = 'https://github.com/jest-community/eslint-plugin-jest';

@@ -235,3 +229,4 @@

const reparseAsMatcher = parsedMember => _objectSpread(_objectSpread({}, parsedMember), {}, {
const reparseAsMatcher = parsedMember => ({ ...parsedMember,
/**

@@ -270,5 +265,5 @@ * The arguments being passed to this `Matcher`, if any.

const negation = parsedMember.node.parent && isExpectMember(parsedMember.node.parent, ModifierName.not) ? parsedMember.node.parent : undefined;
return _objectSpread(_objectSpread({}, parsedMember), {}, {
return { ...parsedMember,
negation
});
};
};

@@ -275,0 +270,0 @@

@@ -89,3 +89,3 @@ "use strict";

if (callback.body && callback.body.type === _experimentalUtils.AST_NODE_TYPES.BlockStatement) {
if (callback.body.type === _experimentalUtils.AST_NODE_TYPES.BlockStatement) {
callback.body.body.forEach(node => {

@@ -92,0 +92,0 @@ if (node.type === _experimentalUtils.AST_NODE_TYPES.ReturnStatement) {

@@ -79,4 +79,4 @@ "use strict";

promiseCallbacks.some(promiseCallback => {
if (promiseCallback && (0, _utils.isFunction)(promiseCallback) && promiseCallback.body) {
if (isExpectCallPresentInFunction(promiseCallback.body) && node.parent && node.parent.parent && !isParentThenOrPromiseReturned(node.parent.parent, testFunctionBody)) {
if (promiseCallback && (0, _utils.isFunction)(promiseCallback)) {
if (isExpectCallPresentInFunction(promiseCallback.body) && node.parent.parent && !isParentThenOrPromiseReturned(node.parent.parent, testFunctionBody)) {
reportReturnRequired(context, node.parent.parent);

@@ -122,8 +122,3 @@ return true;

} = testFunction;
/* istanbul ignore if https://github.com/typescript-eslint/typescript-eslint/issues/734 */
if (!body) {
throw new Error(`Unexpected null when attempting to fix ${context.getFilename()} - please file a github issue at https://github.com/jest-community/eslint-plugin-jest`);
}
if (body.type !== _experimentalUtils.AST_NODE_TYPES.BlockStatement) {

@@ -130,0 +125,0 @@ return;

@@ -193,3 +193,3 @@ "use strict";

if (matcher.node.parent && (0, _utils.isExpectMember)(matcher.node.parent)) {
if ((0, _utils.isExpectMember)(matcher.node.parent)) {
context.report({

@@ -214,3 +214,3 @@ messageId: 'modifierUnknown',

if (!modifier || !parentNode || !parentNode.parent || modifier.name === _utils.ModifierName.not) {
if (!parentNode.parent || !modifier || modifier.name === _utils.ModifierName.not) {
return;

@@ -217,0 +217,0 @@ }

@@ -51,3 +51,3 @@ "use strict";

description: 'Enforce valid titles',
recommended: false
recommended: 'error'
},

@@ -54,0 +54,0 @@ messages: {

{
"name": "eslint-plugin-jest",
"version": "23.20.0",
"version": "24.0.0",
"description": "Eslint rules for Jest",

@@ -23,7 +23,7 @@ "keywords": [

"scripts": {
"build": "babel --extensions .js,.ts src --out-dir lib --copy-files",
"postbuild": "rimraf lib/__tests__ lib/**/__tests__",
"build": "babel --extensions .js,.ts src --out-dir lib --copy-files && rimraf lib/__tests__ 'lib/**/__tests__'",
"lint": "eslint . --ignore-pattern '!.eslintrc.js' --ext js,ts",
"prepack": "yarn build",
"prettylint": "prettylint docs/**/*.md README.md package.json",
"prepack": "rimraf lib && yarn build",
"prettier:check": "prettier --check 'docs/**/*.md' README.md '.github/**' package.json tsconfig.json src/globals.json .yarnrc.yml",
"prettier:write": "prettier --write 'docs/**/*.md' README.md '.github/**' package.json tsconfig.json src/globals.json .yarnrc.yml",
"test": "jest",

@@ -45,10 +45,4 @@ "tools:regenerate-docs": "ts-node -T tools/regenerate-docs",

"lint-staged": {
"*.{js,ts}": [
"eslint --fix",
"git add"
],
"*.{md,json}": [
"prettier --write",
"git add"
]
"*.{js,ts}": "eslint --fix",
"*.{md,json,yml}": "prettier --write"
},

@@ -92,3 +86,3 @@ "prettier": {

"dependencies": {
"@typescript-eslint/experimental-utils": "^2.5.0"
"@typescript-eslint/experimental-utils": "^4.0.1"
},

@@ -100,17 +94,17 @@ "devDependencies": {

"@babel/preset-typescript": "^7.3.3",
"@commitlint/cli": "^8.2.0",
"@commitlint/config-conventional": "^8.2.0",
"@commitlint/cli": "^9.1.1",
"@commitlint/config-conventional": "^9.1.1",
"@schemastore/package": "^0.0.6",
"@semantic-release/changelog": "^3.0.5",
"@semantic-release/git": "^7.0.17",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@types/dedent": "^0.7.0",
"@types/jest": "^25.1.0",
"@types/node": "^12.6.6",
"@types/prettier": "^1.19.0",
"@typescript-eslint/eslint-plugin": "^2.5.0",
"@typescript-eslint/parser": "^2.5.0",
"babel-jest": "^25.2.0",
"@types/jest": "^26.0.0",
"@types/node": "^14.0.0",
"@types/prettier": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"babel-jest": "^26.0.1",
"babel-plugin-replace-ts-export-assignment": "^0.0.2",
"dedent": "^0.7.0",
"eslint": "^5.1.0 || ^6.0.0",
"eslint": "^5.1.0 || ^6.0.0 || ^7.0.0",
"eslint-config-prettier": "^6.5.0",

@@ -123,13 +117,12 @@ "eslint-plugin-eslint-comments": "^3.1.2",

"eslint-plugin-prettier": "^3.0.0",
"husky": "^3.0.9",
"jest": "^25.2.0",
"husky": "^4.2.5",
"jest": "^26.0.1",
"jest-runner-eslint": "^0.10.0",
"lint-staged": "^9.4.2",
"prettier": "^1.19.1",
"prettylint": "^1.0.0",
"lint-staged": "^10.2.2",
"prettier": "^2.0.5",
"resolve-from": "^5.0.0",
"rimraf": "^3.0.0",
"semantic-release": "^15.13.28",
"ts-node": "^8.10.1",
"typescript": "^3.5.3"
"semantic-release": "^17.0.7",
"ts-node": "^9.0.0",
"typescript": "^4.0.0"
},

@@ -140,3 +133,3 @@ "peerDependencies": {

"engines": {
"node": ">=8"
"node": ">=10"
},

@@ -143,0 +136,0 @@ "release": {

@@ -138,5 +138,6 @@ <div align="center">

| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | Disallow commented out tests | ![recommended][] | |
| [no-conditional-expect](docs/rules/no-conditional-expect.md) | Prevent calling `expect` conditionally | | |
| [no-deprecated-functions](docs/rules/no-deprecated-functions.md) | Disallow use of deprecated functions | | ![fixable][] |
| [no-conditional-expect](docs/rules/no-conditional-expect.md) | Prevent calling `expect` conditionally | ![recommended][] | |
| [no-deprecated-functions](docs/rules/no-deprecated-functions.md) | Disallow use of deprecated functions | ![recommended][] | ![fixable][] |
| [no-disabled-tests](docs/rules/no-disabled-tests.md) | Disallow disabled tests | ![recommended][] | |
| [no-done-callback](docs/rules/no-done-callback.md) | Avoid using a callback in asynchronous tests and hooks | ![recommended][] | ![suggest][] |
| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | Disallow duplicate setup and teardown hooks | | |

@@ -148,3 +149,3 @@ | [no-export](docs/rules/no-export.md) | Disallow using `exports` in files containing tests | ![recommended][] | |

| [no-if](docs/rules/no-if.md) | Disallow conditional logic | | |
| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | Disallow string interpolation inside snapshots | | |
| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | Disallow string interpolation inside snapshots | ![recommended][] | |
| [no-jasmine-globals](docs/rules/no-jasmine-globals.md) | Disallow Jasmine globals | ![recommended][] | ![fixable][] |

@@ -156,3 +157,2 @@ | [no-jest-import](docs/rules/no-jest-import.md) | Disallow importing Jest | ![recommended][] | |

| [no-standalone-expect](docs/rules/no-standalone-expect.md) | Disallow using `expect` outside of `it` or `test` blocks | ![recommended][] | |
| [no-test-callback](docs/rules/no-test-callback.md) | Avoid using a callback in asynchronous tests | ![recommended][] | ![suggest][] |
| [no-test-prefixes](docs/rules/no-test-prefixes.md) | Use `.only` and `.skip` over `f` and `x` | ![recommended][] | ![fixable][] |

@@ -175,3 +175,3 @@ | [no-test-return-statement](docs/rules/no-test-return-statement.md) | Disallow explicitly returning from tests | | |

| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | Enforce having return statement when testing with promises | ![recommended][] | |
| [valid-title](docs/rules/valid-title.md) | Enforce valid titles | | ![fixable][] |
| [valid-title](docs/rules/valid-title.md) | Enforce valid titles | ![recommended][] | ![fixable][] |

@@ -178,0 +178,0 @@ <!-- end rules list -->

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc