diff --git a/configs/async-await.js b/configs/async-await.js index c92d008..ef1b33e 100644 --- a/configs/async-await.js +++ b/configs/async-await.js @@ -1,3 +1,12 @@ +let _pluginName = 'eslint-plugin-async-await'; +let _pluginVsn = require('../package.json').peerDependencies[_pluginName]; +let _pluginActualVsn = require(`${_pluginName}/package.json`).version; +let _semver = require('semver'); + +if (!_semver.satisfies(_pluginActualVsn, _pluginVsn)) { + throw new Error(`Expected ${_pluginName}@${_pluginVsn} but found version ${_pluginActualVsn} installed.`); +} + module.exports = { plugins: [ 'async-await' diff --git a/configs/babel.js b/configs/babel.js index c67bed5..85a417c 100644 --- a/configs/babel.js +++ b/configs/babel.js @@ -1,3 +1,12 @@ +let _pluginName = 'eslint-plugin-babel'; +let _pluginVsn = require('../package.json').peerDependencies[_pluginName]; +let _pluginActualVsn = require(`${_pluginName}/package.json`).version; +let _semver = require('semver'); + +if (!_semver.satisfies(_pluginActualVsn, _pluginVsn)) { + throw new Error(`Expected ${_pluginName}@${_pluginVsn} but found version ${_pluginActualVsn} installed.`); +} + let _ = require('lodash'); let _basic = require('./basic'); diff --git a/configs/eslint-comments.js b/configs/eslint-comments.js index 80c7c9d..66779e6 100644 --- a/configs/eslint-comments.js +++ b/configs/eslint-comments.js @@ -1,3 +1,12 @@ +let _pluginName = 'eslint-plugin-eslint-comments'; +let _pluginVsn = require('../package.json').peerDependencies[_pluginName]; +let _pluginActualVsn = require(`${_pluginName}/package.json`).version; +let _semver = require('semver'); + +if (!_semver.satisfies(_pluginActualVsn, _pluginVsn)) { + throw new Error(`Expected ${_pluginName}@${_pluginVsn} but found version ${_pluginActualVsn} installed.`); +} + module.exports = { plugins: [ 'eslint-comments' diff --git a/configs/firecloud.js b/configs/firecloud.js index 409b754..8d16633 100644 --- a/configs/firecloud.js +++ b/configs/firecloud.js @@ -1,3 +1,12 @@ +let _pluginName = 'eslint-plugin-firecloud'; +let _pluginVsn = require('../package.json').peerDependencies[_pluginName]; +let _pluginActualVsn = require(`${_pluginName}/package.json`).version; +let _semver = require('semver'); + +if (!_semver.satisfies(_pluginActualVsn, _pluginVsn)) { + throw new Error(`Expected ${_pluginName}@${_pluginVsn} but found version ${_pluginActualVsn} installed.`); +} + module.exports = { plugins: [ 'firecloud' diff --git a/configs/fp.js b/configs/fp.js index 82ba227..ccf70c6 100644 --- a/configs/fp.js +++ b/configs/fp.js @@ -1,3 +1,12 @@ +let _pluginName = 'eslint-plugin-fp'; +let _pluginVsn = require('../package.json').peerDependencies[_pluginName]; +let _pluginActualVsn = require(`${_pluginName}/package.json`).version; +let _semver = require('semver'); + +if (!_semver.satisfies(_pluginActualVsn, _pluginVsn)) { + throw new Error(`Expected ${_pluginName}@${_pluginVsn} but found version ${_pluginActualVsn} installed.`); +} + module.exports = { plugins: [ 'fp' diff --git a/configs/import.js b/configs/import.js index 2b84747..66f3b15 100644 --- a/configs/import.js +++ b/configs/import.js @@ -1,3 +1,12 @@ +let _pluginName = 'eslint-plugin-import'; +let _pluginVsn = require('../package.json').peerDependencies[_pluginName]; +let _pluginActualVsn = require(`${_pluginName}/package.json`).version; +let _semver = require('semver'); + +if (!_semver.satisfies(_pluginActualVsn, _pluginVsn)) { + throw new Error(`Expected ${_pluginName}@${_pluginVsn} but found version ${_pluginActualVsn} installed.`); +} + module.exports = { plugins: [ 'import' diff --git a/configs/jsdoc.js b/configs/jsdoc.js index 4895c2e..081d8bc 100644 --- a/configs/jsdoc.js +++ b/configs/jsdoc.js @@ -1,3 +1,12 @@ +let _pluginName = 'eslint-plugin-jsdoc'; +let _pluginVsn = require('../package.json').peerDependencies[_pluginName]; +let _pluginActualVsn = require(`${_pluginName}/package.json`).version; +let _semver = require('semver'); + +if (!_semver.satisfies(_pluginActualVsn, _pluginVsn)) { + throw new Error(`Expected ${_pluginName}@${_pluginVsn} but found version ${_pluginActualVsn} installed.`); +} + module.exports = { extends: [ 'plugin:jsdoc/recommended' diff --git a/configs/lodash.js b/configs/lodash.js index e9a09c2..78b6d34 100644 --- a/configs/lodash.js +++ b/configs/lodash.js @@ -1,3 +1,12 @@ +let _pluginName = 'eslint-plugin-lodash'; +let _pluginVsn = require('../package.json').peerDependencies[_pluginName]; +let _pluginActualVsn = require(`${_pluginName}/package.json`).version; +let _semver = require('semver'); + +if (!_semver.satisfies(_pluginActualVsn, _pluginVsn)) { + throw new Error(`Expected ${_pluginName}@${_pluginVsn} but found version ${_pluginActualVsn} installed.`); +} + module.exports = { extends: [ 'plugin:lodash/recommended' diff --git a/configs/no-null.js b/configs/no-null.js index 08cc393..91d3ca6 100644 --- a/configs/no-null.js +++ b/configs/no-null.js @@ -1,3 +1,12 @@ +let _pluginName = 'eslint-plugin-no-null'; +let _pluginVsn = require('../package.json').peerDependencies[_pluginName]; +let _pluginActualVsn = require(`${_pluginName}/package.json`).version; +let _semver = require('semver'); + +if (!_semver.satisfies(_pluginActualVsn, _pluginVsn)) { + throw new Error(`Expected ${_pluginName}@${_pluginVsn} but found version ${_pluginActualVsn} installed.`); +} + module.exports = { plugins: [ 'no-null' diff --git a/configs/proper-arrows.js b/configs/proper-arrows.js index 6e5dddc..56cf3ff 100644 --- a/configs/proper-arrows.js +++ b/configs/proper-arrows.js @@ -5,6 +5,15 @@ // * https://twitter.com/getify/status/1111257781607301125 // * https://twitter.com/getify/status/1101521219243966466 +let _pluginName = '@getify/eslint-plugin-proper-arrows'; +let _pluginVsn = require('../package.json').peerDependencies[_pluginName]; +let _pluginActualVsn = require(`${_pluginName}/package.json`).version; +let _semver = require('semver'); + +if (!_semver.satisfies(_pluginActualVsn, _pluginVsn)) { + throw new Error(`Expected ${_pluginName}@${_pluginVsn} but found version ${_pluginActualVsn} installed.`); +} + module.exports = { plugins: [ '@getify/proper-arrows'