Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
also check versions for plugins defined as peer deps
Browse files Browse the repository at this point in the history
  • Loading branch information
andreineculau committed Mar 5, 2020
1 parent 7aef7e0 commit 69fdbb5
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 0 deletions.
9 changes: 9 additions & 0 deletions configs/async-await.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
9 changes: 9 additions & 0 deletions configs/babel.js
Original file line number Diff line number Diff line change
@@ -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');

Expand Down
9 changes: 9 additions & 0 deletions configs/eslint-comments.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
9 changes: 9 additions & 0 deletions configs/firecloud.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
9 changes: 9 additions & 0 deletions configs/fp.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
9 changes: 9 additions & 0 deletions configs/import.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
9 changes: 9 additions & 0 deletions configs/jsdoc.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
9 changes: 9 additions & 0 deletions configs/lodash.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
9 changes: 9 additions & 0 deletions configs/no-null.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
9 changes: 9 additions & 0 deletions configs/proper-arrows.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 69fdbb5

Please sign in to comment.