Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions +babel.js

This file was deleted.

40 changes: 25 additions & 15 deletions +chai.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
'use strict';
/* eslint-disable quote-props */
var verifyPeer = require('./verify-peer-dependency');
const verifyPeer = require('./verify-peer-dependency');
verifyPeer('eslint-plugin-chai-expect');
verifyPeer('eslint-plugin-chai-friendly');

module.exports = {
'plugins': [
'chai-expect', // https://www.npmjs.com/package/eslint-plugin-chai-expect
'chai-friendly' // https://www.npmjs.com/package/eslint-plugin-chai-friendly
],
'rules': {
'no-unused-expressions': 'off',
'chai-friendly/no-unused-expressions': [ 'error', { 'allowShortCircuit': true, 'allowTernary': true } ],
const { defineConfig } = require('eslint/config');
const pluginChaiExpect = require('eslint-plugin-chai-expect');
const pluginChaiFriendly = require('eslint-plugin-chai-friendly');
const { chai } = require('globals');

// chai rules
'chai-expect/missing-assertion': 'warn', // TODO: Bump to error in next major
'chai-expect/terminating-properties': 'warn',
module.exports = defineConfig([
{
name: 'axway/+chai',
plugins: {
'chai-expect': pluginChaiExpect,
'chai-friendly': pluginChaiFriendly
},
languageOptions: {
globals: chai
},
rules: {
'no-unused-expressions': 'off',
'chai-friendly/no-unused-expressions': [ 'error', { allowShortCircuit: true, allowTernary: true } ],

// chai rules
'chai-expect/missing-assertion': 'error',
'chai-expect/terminating-properties': 'warn',
}
}
};
]);
70 changes: 21 additions & 49 deletions +mocha.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,25 @@
/* eslint-disable quote-props */
var verifyPeer = require('./verify-peer-dependency');
const verifyPeer = require('./verify-peer-dependency');
verifyPeer('eslint-plugin-mocha');

module.exports = {
'globals': {
// mocha
'after': false,
'afterEach': false,
'before': false,
'beforeEach': false,
'context': false,
'describe': false,
'it': false,
'mocha': false,
'run': false,
'setup': false,
'specify': false,
'suite': false,
'suiteSetup': false,
'suiteTeardown': false,
'teardown': false,
'test': false,
'xcontext': false,
'xdescribe': false,
'xit': false,
'xspecify': false,
const { defineConfig } = require('eslint/config');
const { default: pluginMocha } = require('eslint-plugin-mocha');
const { mocha } = require('globals');

// should
'should': false,
'Assertion': false,
'PromisedAssertion': false,

// chai
'expect': false,

// sinon
'sinon': false,
'spy': false,
'stub': false
},
'plugins': [
'mocha'
],
'rules': {
// mocha rules
'mocha/handle-done-callback': 'error',
'mocha/no-exclusive-tests': 'warn',
'mocha/no-identical-title': 'error',
'mocha/no-skipped-tests': 'warn',
'mocha/valid-test-description': 'off'
module.exports = defineConfig([
{
name: 'axway/+mocha',
plugins: {
mocha: pluginMocha
},
languageOptions: {
globals: mocha
},
rules: {
// mocha rules
'mocha/handle-done-callback': 'error',
'mocha/no-exclusive-tests': 'warn',
'mocha/no-identical-title': 'error',
'mocha/valid-test-title': 'off'
}
}
};
]);
Loading