From 7efefe1b0a49a370a6d87430ba37039ab4b88882 Mon Sep 17 00:00:00 2001 From: Dominik Ferber Date: Wed, 9 May 2018 22:45:21 +0200 Subject: [PATCH] refactor: spring cleanup Remove babel and convert code to use CommonJS format. Convert rules to updated format (https://eslint.org/docs/developer-guide/working-with-rules). BREAKING CHANGE: Changes exported, recommended eslint config (`extends: ["plugin:meteor/recommended"]`) to enable ecmaVersion 6, sourceType module and jsx for the ESLint parser. closes #654 --- .babelrc | 10 - .eslintignore | 1 - .eslintrc.yml | 1 + .gitignore | 1 - .travis.yml | 4 +- README.md | 20 +- a.js | 0 docs/guides/development.md | 27 +- docs/guides/setup.md | 36 +- lib/index.js | 76 +- lib/rules/audit-argument-checks.js | 144 +- lib/rules/eventmap-params.js | 152 +- lib/rules/no-dom-lookup-on-created.js | 23 +- lib/rules/no-session.js | 19 +- .../no-template-lifecycle-assignments.js | 95 +- lib/rules/no-template-parent-data.js | 31 +- lib/rules/no-zero-timeout.js | 37 +- lib/rules/prefer-session-equals.js | 68 +- lib/rules/prefix-eventmap-selectors.js | 107 +- lib/rules/scope-dom-lookups.js | 21 +- lib/rules/template-names.js | 68 +- lib/util/ast/getPropertyName.js | 4 +- lib/util/ast/index.js | 12 +- lib/util/ast/isFunction.js | 4 +- lib/util/ast/isMeteorCall.js | 6 +- lib/util/ast/isMeteorProp.js | 4 +- lib/util/ast/isTemplateProp.js | 6 +- lib/util/environment.js | 26 +- .../executors/filterExecutorsByAncestors.js | 12 +- lib/util/executors/getExecutors.js | 8 +- lib/util/executors/getExecutorsByEnv.js | 8 +- lib/util/executors/getExecutorsFromTest.js | 12 +- lib/util/executors/invert.js | 6 +- lib/util/executors/isMeteorBlockOnlyTest.js | 6 +- lib/util/executors/sets.js | 14 +- package-lock.json | 1610 +---------------- package.json | 23 +- scripts/new-rule.js | 37 +- tests/index.js | 8 +- tests/lib/rules/audit-argument-checks.js | 4 +- tests/lib/rules/eventmap-params.js | 4 +- tests/lib/rules/no-dom-lookup-on-created.js | 4 +- tests/lib/rules/no-session.js | 4 +- .../no-template-lifecycle-assignments.js | 4 +- tests/lib/rules/no-template-parent-data.js | 4 +- tests/lib/rules/no-zero-timeout.js | 4 +- tests/lib/rules/prefer-session-equals.js | 4 +- tests/lib/rules/prefix-eventmap-selectors.js | 4 +- tests/lib/rules/scope-dom-lookups.js | 4 +- tests/lib/rules/template-names.js | 4 +- tests/lib/util/ast/getPropertyName.js | 4 +- tests/lib/util/ast/index.js | 4 +- tests/lib/util/ast/isMeteorCall.js | 4 +- .../executors/filterExecutorsByAncestors.js | 4 +- tests/lib/util/executors/getExecutors.js | 6 +- tests/lib/util/executors/getExecutorsByEnv.js | 8 +- .../util/executors/getExecutorsFromTest.js | 4 +- .../util/executors/isMeteorBlockOnlyTest.js | 4 +- tests/lib/util/executors/sets.js | 6 +- 59 files changed, 725 insertions(+), 2110 deletions(-) delete mode 100644 .babelrc create mode 100644 a.js diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 8ed2c5f..0000000 --- a/.babelrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "presets": [ - "es2015", - "stage-3" - ], - "plugins": [ - "transform-runtime", - "transform-object-rest-spread" - ] -} diff --git a/.eslintignore b/.eslintignore index 75663d8..95cc3cd 100755 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,2 @@ node_modules/** coverage/** -dist/** diff --git a/.eslintrc.yml b/.eslintrc.yml index fb1dd5d..6064f17 100755 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -14,3 +14,4 @@ plugins: rules: prettier/prettier: ["error", {"trailingComma": "es5", "singleQuote": true}] semi: ["error", "always"] + global-require: 0 diff --git a/.gitignore b/.gitignore index 90da921..6188f32 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ coverage -dist node_modules npm-debug.log .nyc_output diff --git a/.travis.yml b/.travis.yml index 916d169..e289e60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,11 +17,9 @@ node_js: - 4 - 10 before_install: - - npm i -g npm@^5.3.0 + - npm i -g npm@^6.0.0 - npm -v - npm i -g codeclimate-test-reporter -before_script: - - npm prune script: - npm run test after_success: diff --git a/README.md b/README.md index 2f450ee..e0faacd 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ $ npm install eslint-plugin-meteor --save-dev ## Configuration -Add these keys to your `.eslintrc.json` file: +Create an `.eslintrc.json` file with this content at the root of your project: ```json { @@ -79,7 +79,7 @@ An article with detailed setup instructions can be found [here](https://medium.c This plugin exports a recommended configuration which enforces good Meteor practices. The rules enabled in this configuration can be found in [`lib/index.js`](https://github.com/dferber90/eslint-plugin-meteor/blob/master/lib/index.js). -To enable the recommended configuration use the extends property in your `.eslintrc` config file: +To enable the recommended configuration use the extends property in your `.eslintrc.json` config file: ```json { @@ -90,6 +90,22 @@ To enable the recommended configuration use the extends property in your `.eslin } ``` +You probably also want to enable ESLint to parse ECMAScript 2015 and to support React templates. + +Add the following to your `.eslintrc.json` config file + +```json +{ + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module", + "ecmaFeatures": { + "jsx": true + } + } +} +``` + See [ESLint documentation](http://eslint.org/docs/user-guide/configuring#extending-configuration-files) for more information about extending configuration files. ## Limitations diff --git a/a.js b/a.js new file mode 100644 index 0000000..e69de29 diff --git a/docs/guides/development.md b/docs/guides/development.md index bc2f9c3..ff0a519 100644 --- a/docs/guides/development.md +++ b/docs/guides/development.md @@ -2,7 +2,6 @@ This document describes how developers can contribute by adding rules for ESLint-plugin-Meteor. Before implementing a rule, create an issue to discuss the proposed rule. After getting some feedback, you can develop the rule. Every rule must have adequate tests and documentation. Reading the [ESLint developer guide](http://eslint.org/docs/developer-guide/) is a good start. - Run the following commands to set up ESLint-plugin-Meteor in development mode. ```bash @@ -15,16 +14,25 @@ $ npm install ## Development Setup -This plugin uses ES2015 which is transpiled to ES5 by Babel. All files in `lib/` are transpiled to `dist/`. +This plugin runs untranspiled. The source code needs to be compatible with node version 4 and upwards. + +Run `npm run` to see the available scripts for tests, unit-tests and so on. ```bash -# start transpiling continuously -$ npm run build:w +# run unit-tests only +$ npm run unit-test -# make some changes to the code +# run linter only +$ npm run lint -# run tests +# run unit-tests only $ npm run unit-test + +# run unit-tests in watch mode +$ npm run unit-test:watch + +# run complete test suite +$ npm test ``` ## Linking @@ -33,6 +41,7 @@ npm can link packages. This makes version set up for development available in ot ```bash # Make this package available globally +# by running this command from the root of this package $ npm link # In a project using this plugin, install the linked version @@ -41,7 +50,6 @@ $ npm link eslint-plugin-meteor Read more about linking [here](https://docs.npmjs.com/cli/link). - ## Creating rules Creating rules for ESLint-plugin-Meteor is best done by using the scaffolding tool. @@ -55,16 +63,15 @@ This will scaffold all required files for the new rule. Add the implementation, After implementation, the rule has to be exported from `lib/index.js`. Recommended options for the rule should be set as well (also in `lib/index.js`). - ## Give back After making sure all tests pass and the test-coverage is at 100%, please send a PR to [dferber90/eslint-plugin-meteor](https://github.com/dferber90/eslint-plugin-meteor). -Git commits messages must follow the [conventional changelog](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines) format. - +Git commits messages must follow the [conventional changelog](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines) format. This is important as we're releasing automatically and the next version is determined upon the commit messages. ## Essential Development Resources These specs and tools help enormously when developing new rules. + * [ESTree Spec](https://github.com/estree/estree/blob/master/spec.md) * [Espree Parser](http://eslint.org/parser/) * [JS AST Explorer](http://astexplorer.net/) diff --git a/docs/guides/setup.md b/docs/guides/setup.md index c71659f..827da11 100644 --- a/docs/guides/setup.md +++ b/docs/guides/setup.md @@ -1,13 +1,13 @@ # Setup Guide This document describes how to set up ESLint and ESLint-plugin-Meteor in Meteor projects. -*It must have steps for Meteor projects before 1.3 and with 1.3.* -*It should further show how to use only selected rules (or link to the page of the ESLint documentation)* - +_It must have steps for Meteor projects before 1.3 and with 1.3._ +_It should further show how to use only selected rules (or link to the page of the ESLint documentation)_ This guide assumes you have [npm](https://www.npmjs.com/) installed. ## Setup + If you don't have a `package.json` at the root of your Meteor project, create one with `npm init --yes`. Next, add `private: true` to your package (to avoid some warnings and prevent publishing your project to npm's registry accidentally). Now, install ESLint and ESLint-plugin-Meteor as development dependencies: @@ -23,19 +23,20 @@ A minimal configuration should look like this: ```json { - "plugins": [ - "meteor" - ], - "extends": [ - "plugin:meteor/recommended" - ] + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module", + "ecmaFeatures": { + "jsx": true + } + }, + "plugins": ["meteor"], + "extends": ["plugin:meteor/recommended"] } ``` - And that's it 🎉! - More information on setting up ESLint can be found [here](http://eslint.org/docs/user-guide/configuring). An article with detailed setup instructions specifically for Meteor projects can be found [here](https://medium.com/@dferber90/linting-meteor-8f229ebc7942). @@ -44,8 +45,8 @@ An article with detailed setup instructions specifically for Meteor projects can Here are some more tips to further improve the setup. - ### Add environments + An environment tells ESLint about defined globals. Since Meteor code can run in the browser and on the server, it's wise to add `browser` and `node`. As Meteor supports ES2015, `es6` should be added as well. And of course the `meteor` environment itself. Since Meteor 1.3 applications can use modules, they should be enabled for ESLint as well. @@ -66,8 +67,8 @@ Since Meteor code can run in the browser and on the server, it's wise to add `br } ``` - ### Collections and globals + ESLint needs to know about globals defined in your application. Add the globals key to `.eslintrc.json`: @@ -84,19 +85,20 @@ Add the globals key to `.eslintrc.json`: Here, you can define all globals your application uses. This is also the place to add globals provided through packages from Atmosphere. The boolean values tell ESLint whether it is okay for your application code to overwrite these globals (`true`) or not (`false`). - ### Usage with React + If you are using React, you should: -- enable JSX syntax (see: [ESLint configuration documentation](http://eslint.org/docs/user-guide/configuring#specifying-parser-options)) -- use ESLint-plugin-React (see: [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react)) +* enable JSX syntax (see: [ESLint configuration documentation](http://eslint.org/docs/user-guide/configuring#specifying-parser-options)) +* use ESLint-plugin-React (see: [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react)) ## ESLint-config-airbnb + Use a rule preset like [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb). It has lots of well-thought-out rules. - ### Using YAML instead + ESLint supports different formats in which the configuration can be specified. If `.eslintrc.json` is renamed to `.eslint.yaml` then the full configuration can be written like this: diff --git a/lib/index.js b/lib/index.js index 3125119..9f6fe93 100755 --- a/lib/index.js +++ b/lib/index.js @@ -1,46 +1,40 @@ -import auditArgumentChecks from './rules/audit-argument-checks'; -import noSession from './rules/no-session'; -import noBlazeLifecycleAssignment from './rules/no-template-lifecycle-assignments'; -import noZeroTimeout from './rules/no-zero-timeout'; -import eventmapParams from './rules/eventmap-params'; -import prefixEventmapSelectors from './rules/prefix-eventmap-selectors'; -import preferSessionEquals from './rules/prefer-session-equals'; -import templateNamingConvention from './rules/template-names'; -import scopeDomLookups from './rules/scope-dom-lookups'; -import noDomLookupOnCreated from './rules/no-dom-lookup-on-created'; -import noTemplateParentData from './rules/no-template-parent-data'; - -export const rules = { - 'audit-argument-checks': auditArgumentChecks, - 'no-session': noSession, - 'no-template-lifecycle-assignments': noBlazeLifecycleAssignment, - 'no-zero-timeout': noZeroTimeout, - 'eventmap-params': eventmapParams, - 'prefix-eventmap-selectors': prefixEventmapSelectors, - 'prefer-session-equals': preferSessionEquals, - 'template-names': templateNamingConvention, - 'scope-dom-lookups': scopeDomLookups, - 'no-dom-lookup-on-created': noDomLookupOnCreated, - 'no-template-parent-data': noTemplateParentData, +const allRules = { + 'audit-argument-checks': require('./rules/audit-argument-checks'), + 'no-session': require('./rules/no-session'), + 'no-template-lifecycle-assignments': require('./rules/no-template-lifecycle-assignments'), + 'no-zero-timeout': require('./rules/no-zero-timeout'), + 'eventmap-params': require('./rules/eventmap-params'), + 'prefix-eventmap-selectors': require('./rules/prefix-eventmap-selectors'), + 'prefer-session-equals': require('./rules/prefer-session-equals'), + 'template-names': require('./rules/template-names'), + 'scope-dom-lookups': require('./rules/scope-dom-lookups'), + 'no-dom-lookup-on-created': require('./rules/no-dom-lookup-on-created'), + 'no-template-parent-data': require('./rules/no-template-parent-data'), }; -export const configs = { - recommended: { - rules: { - 'meteor/audit-argument-checks': 2, - 'meteor/no-session': 2, - 'meteor/no-template-lifecycle-assignments': 2, - 'meteor/no-zero-timeout': 2, - 'meteor/eventmap-params': 2, - 'meteor/prefix-eventmap-selectors': 0, - 'meteor/prefer-session-equals': 0, - 'meteor/template-names': 2, - 'meteor/scope-dom-lookups': 0, - 'meteor/no-dom-lookup-on-created': 0, - 'meteor/no-template-parent-data': 0, +module.exports = { + rules: allRules, + configs: { + recommended: { + parserOptions: { + ecmaVersion: 6, + sourceType: 'module', + ecmaFeatures: { jsx: true }, + }, + plugins: ['meteor'], + rules: { + 'meteor/audit-argument-checks': 2, + 'meteor/no-session': 2, + 'meteor/no-template-lifecycle-assignments': 2, + 'meteor/no-zero-timeout': 2, + 'meteor/eventmap-params': 2, + 'meteor/prefix-eventmap-selectors': 0, + 'meteor/prefer-session-equals': 0, + 'meteor/template-names': 2, + 'meteor/scope-dom-lookups': 0, + 'meteor/no-dom-lookup-on-created': 0, + 'meteor/no-template-parent-data': 0, + }, }, }, - guide: { - rules: {}, - }, }; diff --git a/lib/rules/audit-argument-checks.js b/lib/rules/audit-argument-checks.js index 3f7d8cd..0eb0337 100644 --- a/lib/rules/audit-argument-checks.js +++ b/lib/rules/audit-argument-checks.js @@ -3,89 +3,93 @@ * @author Dominik Ferber */ -import { isMeteorCall, isFunction } from '../util/ast'; +const { isMeteorCall, isFunction } = require('../util/ast'); // ----------------------------------------------------------------------------- // Rule Definition // ----------------------------------------------------------------------------- -export default context => { - // --------------------------------------------------------------------------- - // Helpers - // --------------------------------------------------------------------------- +module.exports = { + meta: { + schema: [], + }, + create: context => { + // --------------------------------------------------------------------------- + // Helpers + // --------------------------------------------------------------------------- - function auditArgumentChecks(node) { - if (!isFunction(node.type)) { - return; - } + function auditArgumentChecks(node) { + if (!isFunction(node.type)) { + return; + } - const checkedParams = []; + const checkedParams = []; - // short-circuit - if (node.params.length === 0) { - return; - } + // short-circuit + if (node.params.length === 0) { + return; + } - if (node.body.type === 'BlockStatement') { - node.body.body.forEach(expression => { - if ( - expression.type === 'ExpressionStatement' && - expression.expression.type === 'CallExpression' && - expression.expression.callee.type === 'Identifier' && - expression.expression.callee.name === 'check' && - expression.expression.arguments.length > 1 && - expression.expression.arguments[0].type === 'Identifier' - ) { - checkedParams.push(expression.expression.arguments[0].name); - } - if ( - expression.type === 'ExpressionStatement' && - expression.expression.type === 'CallExpression' && - expression.expression.callee.type === 'Identifier' && - expression.expression.callee.name === 'check' && - expression.expression.arguments.length > 1 && - expression.expression.arguments[0].type === 'ArrayExpression' - ) { - expression.expression.arguments[0].elements.forEach(element => { - if (element.type === 'Identifier') checkedParams.push(element.name); - }); + if (node.body.type === 'BlockStatement') { + node.body.body.forEach(expression => { + if ( + expression.type === 'ExpressionStatement' && + expression.expression.type === 'CallExpression' && + expression.expression.callee.type === 'Identifier' && + expression.expression.callee.name === 'check' && + expression.expression.arguments.length > 1 && + expression.expression.arguments[0].type === 'Identifier' + ) { + checkedParams.push(expression.expression.arguments[0].name); + } + if ( + expression.type === 'ExpressionStatement' && + expression.expression.type === 'CallExpression' && + expression.expression.callee.type === 'Identifier' && + expression.expression.callee.name === 'check' && + expression.expression.arguments.length > 1 && + expression.expression.arguments[0].type === 'ArrayExpression' + ) { + expression.expression.arguments[0].elements.forEach(element => { + if (element.type === 'Identifier') + checkedParams.push(element.name); + }); + } + }); + } + + node.params.forEach(param => { + if (param.type === 'Identifier') { + if (checkedParams.indexOf(param.name) === -1) { + context.report(param, `"${param.name}" is not checked`); + } } }); } - node.params.forEach(param => { - if (param.type === 'Identifier') { - if (checkedParams.indexOf(param.name) === -1) { - context.report(param, `"${param.name}" is not checked`); - } - } - }); - } - - // --------------------------------------------------------------------------- - // Public - // --------------------------------------------------------------------------- + // --------------------------------------------------------------------------- + // Public + // --------------------------------------------------------------------------- - return { - CallExpression: node => { - // publications - if (isMeteorCall(node, 'publish') && node.arguments.length >= 2) { - auditArgumentChecks(node.arguments[1]); - return; - } + return { + CallExpression: node => { + // publications + if (isMeteorCall(node, 'publish') && node.arguments.length >= 2) { + auditArgumentChecks(node.arguments[1]); + return; + } - // method - if ( - isMeteorCall(node, 'methods') && - (node.arguments.length > 0 && - node.arguments[0].type === 'ObjectExpression') - ) { - node.arguments[0].properties.forEach(property => { - auditArgumentChecks(property.value); - }); - } - }, - }; + // method + if ( + isMeteorCall(node, 'methods') && + (node.arguments.length > 0 && + node.arguments[0].type === 'ObjectExpression') + ) { + node.arguments[0].properties.forEach(property => { + auditArgumentChecks(property.value); + }); + } + }, + }; + }, }; - -export const schema = []; diff --git a/lib/rules/eventmap-params.js b/lib/rules/eventmap-params.js index 5cbd660..b2e66e2 100644 --- a/lib/rules/eventmap-params.js +++ b/lib/rules/eventmap-params.js @@ -5,92 +5,98 @@ * See LICENSE file in root directory for full license. */ -import { isFunction, isTemplateProp } from '../util/ast'; +const { isFunction, isTemplateProp } = require('../util/ast'); // ----------------------------------------------------------------------------- // Rule Definition // ----------------------------------------------------------------------------- -export default context => { - // --------------------------------------------------------------------------- - // Helpers - // --------------------------------------------------------------------------- +module.exports = { + meta: { + schema: [ + { + type: 'object', + properties: { + eventParamName: { + type: 'string', + }, + templateInstanceParamName: { + type: 'string', + }, + preventDestructuring: { + enum: ['neither', 'both', 'templateInstance', 'event'], + }, + }, + additionalProperties: false, + }, + ], + }, + create: context => { + // --------------------------------------------------------------------------- + // Helpers + // --------------------------------------------------------------------------- - function ensureParamName(param, expectedParamName, preventDestructuring) { - if (param) { - if (param.type === 'ObjectPattern' && preventDestructuring) { - context.report( - param, - `Unexpected destructuring, use name "${expectedParamName}"` - ); - } else if ( - param.type === 'Identifier' && - param.name !== expectedParamName - ) { - context.report( - param, - `Invalid parameter name, use "${expectedParamName}" instead` - ); + function ensureParamName(param, expectedParamName, preventDestructuring) { + if (param) { + if (param.type === 'ObjectPattern' && preventDestructuring) { + context.report( + param, + `Unexpected destructuring, use name "${expectedParamName}"` + ); + } else if ( + param.type === 'Identifier' && + param.name !== expectedParamName + ) { + context.report( + param, + `Invalid parameter name, use "${expectedParamName}" instead` + ); + } } } - } - function validateEventDefinition(node) { - const eventHandler = node.value; - if (isFunction(eventHandler.type)) { - const { - eventParamName = 'event', - templateInstanceParamName = 'templateInstance', - preventDestructuring = 'neither', - } = - context.options[0] || {}; + function validateEventDefinition(node) { + const eventHandler = node.value; + if (isFunction(eventHandler.type)) { + const { + eventParamName = 'event', + templateInstanceParamName = 'templateInstance', + preventDestructuring = 'neither', + } = + context.options[0] || {}; - ensureParamName( - eventHandler.params[0], - eventParamName, - preventDestructuring === 'both' || preventDestructuring === 'event' - ); - ensureParamName( - eventHandler.params[1], - templateInstanceParamName, - preventDestructuring === 'both' || - preventDestructuring === 'templateInstance' - ); + ensureParamName( + eventHandler.params[0], + eventParamName, + preventDestructuring === 'both' || preventDestructuring === 'event' + ); + ensureParamName( + eventHandler.params[1], + templateInstanceParamName, + preventDestructuring === 'both' || + preventDestructuring === 'templateInstance' + ); + } } - } - // --------------------------------------------------------------------------- - // Public - // --------------------------------------------------------------------------- + // --------------------------------------------------------------------------- + // Public + // --------------------------------------------------------------------------- - return { - CallExpression: node => { - if ( - node.arguments.length === 0 || - !isTemplateProp(node.callee, 'events') - ) { - return; - } - const eventMap = node.arguments[0]; - - if (eventMap.type === 'ObjectExpression') { - eventMap.properties.forEach(validateEventDefinition); - } - }, - }; -}; + return { + CallExpression: node => { + if ( + node.arguments.length === 0 || + !isTemplateProp(node.callee, 'events') + ) { + return; + } + const eventMap = node.arguments[0]; -export const schema = [ - { - type: 'object', - properties: { - eventParamName: { - type: 'string', - }, - templateInstanceParamName: { - type: 'string', + if (eventMap.type === 'ObjectExpression') { + eventMap.properties.forEach(validateEventDefinition); + } }, - }, - additionalProperties: false, + }; }, -]; +}; diff --git a/lib/rules/no-dom-lookup-on-created.js b/lib/rules/no-dom-lookup-on-created.js index 69de7b7..2ea07ec 100644 --- a/lib/rules/no-dom-lookup-on-created.js +++ b/lib/rules/no-dom-lookup-on-created.js @@ -5,7 +5,7 @@ * See LICENSE file in root directory for full license. */ -import getPropertyName from '../util/ast/getPropertyName'; +const getPropertyName = require('../util/ast/getPropertyName'); const errorMessage = 'Accessing DOM from "onCreated" is forbidden. Try from "onRendered" instead.'; @@ -34,13 +34,16 @@ const isRelevantTemplateCallExpression = node => const isInRelevantTemplateScope = ancestors => ancestors.some(isRelevantTemplateCallExpression); -export default context => ({ - CallExpression: node => { - if (!isJQueryCallee(node.callee)) return; - if (!isInRelevantTemplateScope(context.getAncestors())) return; - - context.report(node, errorMessage); +module.exports = { + meta: { + schema: [], }, -}); - -export const schema = []; + create: context => ({ + CallExpression: node => { + if (!isJQueryCallee(node.callee)) return; + if (!isInRelevantTemplateScope(context.getAncestors())) return; + + context.report(node, errorMessage); + }, + }), +}; diff --git a/lib/rules/no-session.js b/lib/rules/no-session.js index 14a1434..ff32649 100644 --- a/lib/rules/no-session.js +++ b/lib/rules/no-session.js @@ -7,12 +7,15 @@ // Rule Definition // ----------------------------------------------------------------------------- -export default context => ({ - MemberExpression: node => { - if (node.object.name === 'Session') { - context.report(node, 'Unexpected Session statement'); - } +module.exports = { + meta: { + schema: [], }, -}); - -export const schema = []; + create: context => ({ + MemberExpression: node => { + if (node.object.name === 'Session') { + context.report(node, 'Unexpected Session statement'); + } + }, + }), +}; diff --git a/lib/rules/no-template-lifecycle-assignments.js b/lib/rules/no-template-lifecycle-assignments.js index 43cae26..6d3147d 100644 --- a/lib/rules/no-template-lifecycle-assignments.js +++ b/lib/rules/no-template-lifecycle-assignments.js @@ -7,55 +7,58 @@ // Rule Definition // ----------------------------------------------------------------------------- -export default context => { - // --------------------------------------------------------------------------- - // Helpers - // --------------------------------------------------------------------------- +module.exports = { + meta: { + schema: [], + }, + create: context => { + // --------------------------------------------------------------------------- + // Helpers + // --------------------------------------------------------------------------- - /* - * Check if name is a forbidden property (rendered, created, destroyed) - * @param {String} name The name of the property - * @returns {Boolean} True if name is forbidden. - */ - function isForbidden(name) { - return ['created', 'rendered', 'destroyed'].indexOf(name) !== -1; - } + /* + * Check if name is a forbidden property (rendered, created, destroyed) + * @param {String} name The name of the property + * @returns {Boolean} True if name is forbidden. + */ + function isForbidden(name) { + return ['created', 'rendered', 'destroyed'].indexOf(name) !== -1; + } - function capitalizeFirstLetter(str) { - return str.charAt(0).toUpperCase() + str.slice(1); - } + function capitalizeFirstLetter(str) { + return str.charAt(0).toUpperCase() + str.slice(1); + } - function reportError(node, propertyName) { - context.report( - node, - // eslint-disable-next-line max-len - `Template callback assignment with "${propertyName}" is deprecated. Use "on${capitalizeFirstLetter( - propertyName - )}" instead` - ); - } + function reportError(node, propertyName) { + context.report( + node, + // eslint-disable-next-line max-len + `Template callback assignment with "${propertyName}" is deprecated. Use "on${capitalizeFirstLetter( + propertyName + )}" instead` + ); + } - // --------------------------------------------------------------------------- - // Public - // --------------------------------------------------------------------------- - return { - AssignmentExpression: node => { - if (node.operator === '=') { - const lhs = node.left; - if ( - lhs.type === 'MemberExpression' && - !lhs.computed && - lhs.object.type === 'MemberExpression' && - lhs.object.object.type === 'Identifier' && - lhs.object.object.name === 'Template' && - lhs.property.type === 'Identifier' && - isForbidden(lhs.property.name) - ) { - reportError(node, lhs.property.name); + // --------------------------------------------------------------------------- + // Public + // --------------------------------------------------------------------------- + return { + AssignmentExpression: node => { + if (node.operator === '=') { + const lhs = node.left; + if ( + lhs.type === 'MemberExpression' && + !lhs.computed && + lhs.object.type === 'MemberExpression' && + lhs.object.object.type === 'Identifier' && + lhs.object.object.name === 'Template' && + lhs.property.type === 'Identifier' && + isForbidden(lhs.property.name) + ) { + reportError(node, lhs.property.name); + } } - } - }, - }; + }, + }; + }, }; - -export const schema = []; diff --git a/lib/rules/no-template-parent-data.js b/lib/rules/no-template-parent-data.js index c79712c..f47fe2d 100644 --- a/lib/rules/no-template-parent-data.js +++ b/lib/rules/no-template-parent-data.js @@ -5,18 +5,21 @@ * See LICENSE file in root directory for full license. */ -export default context => ({ - CallExpression: node => { - if ( - node.callee.type === 'MemberExpression' && - node.callee.object.type === 'Identifier' && - node.callee.object.name === 'Template' && - node.callee.property.type === 'Identifier' && - node.callee.property.name === 'parentData' - ) { - context.report(node, 'Forbidden. Pass data explicitly instead'); - } +module.exports = { + meta: { + schema: [], }, -}); - -export const schema = []; + create: context => ({ + CallExpression: node => { + if ( + node.callee.type === 'MemberExpression' && + node.callee.object.type === 'Identifier' && + node.callee.object.name === 'Template' && + node.callee.property.type === 'Identifier' && + node.callee.property.name === 'parentData' + ) { + context.report(node, 'Forbidden. Pass data explicitly instead'); + } + }, + }), +}; diff --git a/lib/rules/no-zero-timeout.js b/lib/rules/no-zero-timeout.js index d6ff41f..7ff9c84 100644 --- a/lib/rules/no-zero-timeout.js +++ b/lib/rules/no-zero-timeout.js @@ -3,26 +3,29 @@ * @author Dominik Ferber */ -import { isMeteorCall } from '../util/ast'; +const { isMeteorCall } = require('../util/ast'); // ----------------------------------------------------------------------------- // Rule Definition // ----------------------------------------------------------------------------- -export default context => ({ - CallExpression: node => { - if (isMeteorCall(node, 'setTimeout')) { - if (node.arguments.length === 1) { - context.report(node, 'Implicit timeout of 0'); - } else if ( - node.arguments.length > 1 && - node.arguments[1].type === 'Literal' && - node.arguments[1].value === 0 - ) { - context.report(node, 'Timeout of 0. Use `Meteor.defer` instead'); - } - } +module.exports = { + meta: { + schema: [], }, -}); - -export const schema = []; + create: context => ({ + CallExpression: node => { + if (isMeteorCall(node, 'setTimeout')) { + if (node.arguments.length === 1) { + context.report(node, 'Implicit timeout of 0'); + } else if ( + node.arguments.length > 1 && + node.arguments[1].type === 'Literal' && + node.arguments[1].value === 0 + ) { + context.report(node, 'Timeout of 0. Use `Meteor.defer` instead'); + } + } + }, + }), +}; diff --git a/lib/rules/prefer-session-equals.js b/lib/rules/prefer-session-equals.js index f93afdc..acf9b9c 100644 --- a/lib/rules/prefer-session-equals.js +++ b/lib/rules/prefer-session-equals.js @@ -20,38 +20,42 @@ const isSessionGetCallExpression = node => // ----------------------------------------------------------------------------- // Rule Definition // ----------------------------------------------------------------------------- -export default context => { - // --------------------------------------------------------------------------- - // Helpers - // --------------------------------------------------------------------------- - const errorMessage = 'Use "Session.equals" instead'; - const checkTest = node => { - switch (node.type) { - case 'BinaryExpression': - case 'LogicalExpression': - checkTest(node.left); - checkTest(node.right); - break; - case 'CallExpression': - if (isSessionGetCallExpression(node)) { - context.report(node.callee, errorMessage); - } - break; - default: - break; - } - }; +module.exports = { + meta: { + schema: [], + }, + create: context => { + // --------------------------------------------------------------------------- + // Helpers + // --------------------------------------------------------------------------- + const errorMessage = 'Use "Session.equals" instead'; - // --------------------------------------------------------------------------- - // Public - // --------------------------------------------------------------------------- - return { - ConditionalExpression: node => { - checkTest(node.test); - }, - IfStatement: node => checkTest(node.test), - }; -}; + const checkTest = node => { + switch (node.type) { + case 'BinaryExpression': + case 'LogicalExpression': + checkTest(node.left); + checkTest(node.right); + break; + case 'CallExpression': + if (isSessionGetCallExpression(node)) { + context.report(node.callee, errorMessage); + } + break; + default: + break; + } + }; -export const schema = []; + // --------------------------------------------------------------------------- + // Public + // --------------------------------------------------------------------------- + return { + ConditionalExpression: node => { + checkTest(node.test); + }, + IfStatement: node => checkTest(node.test), + }; + }, +}; diff --git a/lib/rules/prefix-eventmap-selectors.js b/lib/rules/prefix-eventmap-selectors.js index b8e30c3..87e01cb 100644 --- a/lib/rules/prefix-eventmap-selectors.js +++ b/lib/rules/prefix-eventmap-selectors.js @@ -5,72 +5,75 @@ * See LICENSE file in root directory for full license. */ -import { isTemplateProp } from '../util/ast'; +const { isTemplateProp } = require('../util/ast'); // ----------------------------------------------------------------------------- // Rule Definition // ----------------------------------------------------------------------------- -export default context => { - // --------------------------------------------------------------------------- - // Helpers - // --------------------------------------------------------------------------- +module.exports = { + meta: { + schema: [{ type: 'string' }, { enum: ['relaxed', 'strict'] }], + }, + create: context => { + // --------------------------------------------------------------------------- + // Helpers + // --------------------------------------------------------------------------- - const [prefix = 'js-', mode = 'relaxed'] = context.options; + const [prefix = 'js-', mode = 'relaxed'] = context.options; - // algorithm to parse event map selector taken from blaze itself - // https://github.com/meteor/meteor/blob/15a0369581ef27a6d3d49cb0110d10b1198d5383/packages/blaze/view.js#L867 - function validateEventDefinition(node) { - if (node.key.type !== 'Literal') return; + // algorithm to parse event map selector taken from blaze itself + // https://github.com/meteor/meteor/blob/15a0369581ef27a6d3d49cb0110d10b1198d5383/packages/blaze/view.js#L867 + function validateEventDefinition(node) { + if (node.key.type !== 'Literal') return; - const spec = node.key.value; - const clauses = spec.split(/,\s+/); - clauses.forEach(clause => { - const parts = clause.split(/\s+/); + const spec = node.key.value; + const clauses = spec.split(/,\s+/); + clauses.forEach(clause => { + const parts = clause.split(/\s+/); - if (parts.length === 1) { - if (mode === 'strict') { - context.report(node.key, 'Missing selector'); + if (parts.length === 1) { + if (mode === 'strict') { + context.report(node.key, 'Missing selector'); + } + return; } - return; - } - const selector = parts[1]; + const selector = parts[1]; - if (selector.startsWith('.')) { - if (!selector.startsWith(`.${prefix}`)) { - context.report( - node.key, - `Expected selector to be prefixed with "${prefix}"` - ); - } else if (selector === `.${prefix}`) { - context.report(node.key, 'Selector may not consist of prefix only'); + if (selector.startsWith('.')) { + if (!selector.startsWith(`.${prefix}`)) { + context.report( + node.key, + `Expected selector to be prefixed with "${prefix}"` + ); + } else if (selector === `.${prefix}`) { + context.report(node.key, 'Selector may not consist of prefix only'); + } + } else if (mode === 'strict') { + context.report(node.key, 'Expected selector to be a class'); } - } else if (mode === 'strict') { - context.report(node.key, 'Expected selector to be a class'); - } - }); - } + }); + } - // --------------------------------------------------------------------------- - // Public - // --------------------------------------------------------------------------- + // --------------------------------------------------------------------------- + // Public + // --------------------------------------------------------------------------- - return { - CallExpression: node => { - if ( - node.arguments.length === 0 || - !isTemplateProp(node.callee, 'events') - ) { - return; - } - const eventMap = node.arguments[0]; + return { + CallExpression: node => { + if ( + node.arguments.length === 0 || + !isTemplateProp(node.callee, 'events') + ) { + return; + } + const eventMap = node.arguments[0]; - if (eventMap.type === 'ObjectExpression') { - eventMap.properties.forEach(validateEventDefinition); - } - }, - }; + if (eventMap.type === 'ObjectExpression') { + eventMap.properties.forEach(validateEventDefinition); + } + }, + }; + }, }; - -export const schema = [{ type: 'string' }, { enum: ['relaxed', 'strict'] }]; diff --git a/lib/rules/scope-dom-lookups.js b/lib/rules/scope-dom-lookups.js index 1009547..01be76f 100644 --- a/lib/rules/scope-dom-lookups.js +++ b/lib/rules/scope-dom-lookups.js @@ -5,7 +5,7 @@ * See LICENSE file in root directory for full license. */ -import getPropertyName from '../util/ast/getPropertyName'; +const getPropertyName = require('../util/ast/getPropertyName'); const jQueryNames = new Set(['$', 'jQuery']); @@ -30,12 +30,15 @@ const isRelevantTemplateCallExpression = node => const isInRelevantTemplateScope = ancestors => ancestors.some(isRelevantTemplateCallExpression); -export default context => ({ - CallExpression: node => { - if (!isJQueryIdentifier(node.callee)) return; - if (!isInRelevantTemplateScope(context.getAncestors())) return; - context.report(node, 'Use scoped DOM lookup instead'); +module.exports = { + meta: { + schema: [], }, -}); - -export const schema = []; + create: context => ({ + CallExpression: node => { + if (!isJQueryIdentifier(node.callee)) return; + if (!isInRelevantTemplateScope(context.getAncestors())) return; + context.report(node, 'Use scoped DOM lookup instead'); + }, + }), +}; diff --git a/lib/rules/template-names.js b/lib/rules/template-names.js index 752da81..765dca9 100644 --- a/lib/rules/template-names.js +++ b/lib/rules/template-names.js @@ -39,36 +39,42 @@ const getNameOfProperty = node => const getErrorMessage = expected => `Invalid template name, expected name to be in ${expected}`; -export default context => ({ - MemberExpression: node => { - if (!isTemplateMemberExpression(node)) return; - - const [namingConvention] = context.options; - const templateName = getNameOfProperty(node.object.property); - switch (namingConvention) { - case NAMING_CONVENTIONS.PASCAL: - if (!/^[A-Z]([A-Z]|[a-z]|[0-9])*$/.test(templateName)) { - context.report(node, getErrorMessage(NAMING_CONVENTIONS.PASCAL)); - } - break; - case NAMING_CONVENTIONS.SNAKE: - if (!/^([a-z]|[0-9]|_)+$/i.test(templateName)) { - context.report(node, getErrorMessage(NAMING_CONVENTIONS.SNAKE)); - } - break; - case NAMING_CONVENTIONS.UPPER_SNAKE: - if (!/^[A-Z]([a-z]|[A-Z]|[0-9]|_)+$/.test(templateName)) { - context.report(node, getErrorMessage(NAMING_CONVENTIONS.UPPER_SNAKE)); - } - break; - case NAMING_CONVENTIONS.CAMEL: - default: - if (!/^[a-z]([A-Z]|[a-z]|[0-9])+$/.test(templateName)) { - context.report(node, getErrorMessage(NAMING_CONVENTIONS.CAMEL)); - } - break; - } +module.exports = { + meta: { + schema: [{ enum: Object.values(NAMING_CONVENTIONS) }], }, -}); + create: context => ({ + MemberExpression: node => { + if (!isTemplateMemberExpression(node)) return; -export const schema = [{ enum: Object.values(NAMING_CONVENTIONS) }]; + const [namingConvention] = context.options; + const templateName = getNameOfProperty(node.object.property); + switch (namingConvention) { + case NAMING_CONVENTIONS.PASCAL: + if (!/^[A-Z]([A-Z]|[a-z]|[0-9])*$/.test(templateName)) { + context.report(node, getErrorMessage(NAMING_CONVENTIONS.PASCAL)); + } + break; + case NAMING_CONVENTIONS.SNAKE: + if (!/^([a-z]|[0-9]|_)+$/i.test(templateName)) { + context.report(node, getErrorMessage(NAMING_CONVENTIONS.SNAKE)); + } + break; + case NAMING_CONVENTIONS.UPPER_SNAKE: + if (!/^[A-Z]([a-z]|[A-Z]|[0-9]|_)+$/.test(templateName)) { + context.report( + node, + getErrorMessage(NAMING_CONVENTIONS.UPPER_SNAKE) + ); + } + break; + case NAMING_CONVENTIONS.CAMEL: + default: + if (!/^[a-z]([A-Z]|[a-z]|[0-9])+$/.test(templateName)) { + context.report(node, getErrorMessage(NAMING_CONVENTIONS.CAMEL)); + } + break; + } + }, + }), +}; diff --git a/lib/util/ast/getPropertyName.js b/lib/util/ast/getPropertyName.js index bbdd9dc..bce37ff 100644 --- a/lib/util/ast/getPropertyName.js +++ b/lib/util/ast/getPropertyName.js @@ -1,8 +1,8 @@ -export default function getPropertyName(property) { +module.exports = function getPropertyName(property) { if (property.type === 'Literal') { return property.value; } else if (property.type === 'Identifier') { return property.name; } return false; -} +}; diff --git a/lib/util/ast/index.js b/lib/util/ast/index.js index 9d52026..c44b972 100644 --- a/lib/util/ast/index.js +++ b/lib/util/ast/index.js @@ -1,5 +1,7 @@ -export { default as isMeteorCall } from './isMeteorCall'; -export { default as isMeteorProp } from './isMeteorProp'; -export { default as isTemplateProp } from './isTemplateProp'; -export { default as isFunction } from './isFunction'; -export { default as getPropertyName } from './getPropertyName'; +module.exports = { + isMeteorCall: require('./isMeteorCall'), + isMeteorProp: require('./isMeteorProp'), + isTemplateProp: require('./isTemplateProp'), + isFunction: require('./isFunction'), + getPropertyName: require('./getPropertyName'), +}; diff --git a/lib/util/ast/isFunction.js b/lib/util/ast/isFunction.js index 4a41ed3..36eeca4 100644 --- a/lib/util/ast/isFunction.js +++ b/lib/util/ast/isFunction.js @@ -1,3 +1,3 @@ -export default function isFunction(type) { +module.exports = function isFunction(type) { return type === 'ArrowFunctionExpression' || type === 'FunctionExpression'; -} +}; diff --git a/lib/util/ast/isMeteorCall.js b/lib/util/ast/isMeteorCall.js index 9ec0712..c45a896 100644 --- a/lib/util/ast/isMeteorCall.js +++ b/lib/util/ast/isMeteorCall.js @@ -1,9 +1,9 @@ -import isMeteorProp from './isMeteorProp'; +const isMeteorProp = require('./isMeteorProp'); -export default function isMeteorCall(node, propName) { +module.exports = function isMeteorCall(node, propName) { return ( node.type === 'CallExpression' && node.callee.type === 'MemberExpression' && isMeteorProp(node.callee, propName) ); -} +}; diff --git a/lib/util/ast/isMeteorProp.js b/lib/util/ast/isMeteorProp.js index 748dc9b..517d401 100644 --- a/lib/util/ast/isMeteorProp.js +++ b/lib/util/ast/isMeteorProp.js @@ -1,4 +1,4 @@ -export default function isMeteorProp(node, propName) { +module.exports = function isMeteorProp(node, propName) { return ( node.type === 'MemberExpression' && node.object.type === 'Identifier' && @@ -10,4 +10,4 @@ export default function isMeteorProp(node, propName) { node.property.type === 'Literal' && node.property.value === propName)) ); -} +}; diff --git a/lib/util/ast/isTemplateProp.js b/lib/util/ast/isTemplateProp.js index b034ec1..9cea307 100644 --- a/lib/util/ast/isTemplateProp.js +++ b/lib/util/ast/isTemplateProp.js @@ -1,6 +1,6 @@ -import getPropertyName from './getPropertyName'; +const getPropertyName = require('./getPropertyName'); -export default function isTemplateProp(node, propName) { +module.exports = function isTemplateProp(node, propName) { return ( node.type === 'MemberExpression' && node.object.type === 'MemberExpression' && @@ -8,4 +8,4 @@ export default function isTemplateProp(node, propName) { node.object.object.name === 'Template' && getPropertyName(node.property) === propName ); -} +}; diff --git a/lib/util/environment.js b/lib/util/environment.js index 3bfe8f6..0e7a43e 100644 --- a/lib/util/environment.js +++ b/lib/util/environment.js @@ -1,12 +1,14 @@ -export const PUBLIC = '-public'; -export const PRIVATE = '-private'; -export const CLIENT = '-client'; -export const SERVER = '-server'; -export const PACKAGE = '-pkg'; -export const TEST = '-test'; -export const NODE_MODULE = '-node_module'; -export const UNIVERSAL = '-universal'; -export const PACKAGE_CONFIG = '-pkg-cfg'; -export const MOBILE_CONFIG = '-mobile-cfg'; -export const COMPATIBILITY = '-compat'; -export const NON_METEOR = '-non-meteor'; +module.exports = { + PUBLIC: '-public', + PRIVATE: '-private', + CLIENT: '-client', + SERVER: '-server', + PACKAGE: '-pkg', + TEST: '-test', + NODE_MODULE: '-node_module', + UNIVERSAL: '-universal', + PACKAGE_CONFIG: '-pkg-cfg', + MOBILE_CONFIG: '-mobile-cfg', + COMPATIBILITY: '-compat', + NON_METEOR: '-non-meteor', +}; diff --git a/lib/util/executors/filterExecutorsByAncestors.js b/lib/util/executors/filterExecutorsByAncestors.js index d46d079..fa416ad 100644 --- a/lib/util/executors/filterExecutorsByAncestors.js +++ b/lib/util/executors/filterExecutorsByAncestors.js @@ -1,10 +1,10 @@ -import invariant from 'invariant'; -import isMeteorBlockOnlyTest from './isMeteorBlockOnlyTest'; -import getExecutorsFromTest from './getExecutorsFromTest'; -import { intersection, difference } from './sets'; +const invariant = require('invariant'); +const isMeteorBlockOnlyTest = require('./isMeteorBlockOnlyTest'); +const getExecutorsFromTest = require('./getExecutorsFromTest'); +const { intersection, difference } = require('./sets'); // Set -> Array -> Set -export default function filterExecutorsByAncestors( +module.exports = function filterExecutorsByAncestors( originalExecutors, ancestors ) { @@ -31,4 +31,4 @@ export default function filterExecutorsByAncestors( } return executors; -} +}; diff --git a/lib/util/executors/getExecutors.js b/lib/util/executors/getExecutors.js index a19b676..308224b 100644 --- a/lib/util/executors/getExecutors.js +++ b/lib/util/executors/getExecutors.js @@ -1,7 +1,7 @@ -import filterExecutorsByAncestors from './filterExecutorsByAncestors'; -import getExecutorsByEnv from './getExecutorsByEnv'; +const filterExecutorsByAncestors = require('./filterExecutorsByAncestors'); +const getExecutorsByEnv = require('./getExecutorsByEnv'); // ENVIRONMENT -> Context -> Set -export default function getExecutors(env, ancestors) { +module.exports = function getExecutors(env, ancestors) { return filterExecutorsByAncestors(getExecutorsByEnv(env), ancestors); -} +}; diff --git a/lib/util/executors/getExecutorsByEnv.js b/lib/util/executors/getExecutorsByEnv.js index cc196f9..9e60907 100644 --- a/lib/util/executors/getExecutorsByEnv.js +++ b/lib/util/executors/getExecutorsByEnv.js @@ -1,4 +1,4 @@ -import { +const { PUBLIC, PRIVATE, CLIENT, @@ -11,14 +11,14 @@ import { MOBILE_CONFIG, COMPATIBILITY, NON_METEOR, -} from '../environment'; +} = require('../environment'); /** * Transforms an environment into executors * @param {ENVIRONMENT} env An Environment * @return {Set} A Set of executors */ -export default function getExecutorsByEnv(env) { +module.exports = function getExecutorsByEnv(env) { const executors = new Set(); switch (env) { case CLIENT: @@ -46,4 +46,4 @@ export default function getExecutorsByEnv(env) { break; } return executors; -} +}; diff --git a/lib/util/executors/getExecutorsFromTest.js b/lib/util/executors/getExecutorsFromTest.js index fcf73aa..a07477c 100644 --- a/lib/util/executors/getExecutorsFromTest.js +++ b/lib/util/executors/getExecutorsFromTest.js @@ -1,10 +1,10 @@ -import invariant from 'invariant'; -import isMeteorProp from '../ast/isMeteorProp'; -import { union, intersection } from './sets'; -import invert from './invert'; +const invariant = require('invariant'); +const isMeteorProp = require('../ast/isMeteorProp'); +const { union, intersection } = require('./sets'); +const invert = require('./invert'); // Nodes -> Set -export default function getExecutorsFromTest(test) { +module.exports = function getExecutorsFromTest(test) { switch (test.type) { case 'MemberExpression': if (isMeteorProp(test, 'isClient')) { @@ -36,4 +36,4 @@ export default function getExecutorsFromTest(test) { 'Called getExecutorsFromTest on unkown node type' ); } -} +}; diff --git a/lib/util/executors/invert.js b/lib/util/executors/invert.js index 356d9fa..03f9814 100644 --- a/lib/util/executors/invert.js +++ b/lib/util/executors/invert.js @@ -1,5 +1,5 @@ -import { difference } from './sets'; +const { difference } = require('./sets'); -export default function invert(executors) { +module.exports = function invert(executors) { return difference(new Set(['browser', 'server', 'cordova']), executors); -} +}; diff --git a/lib/util/executors/isMeteorBlockOnlyTest.js b/lib/util/executors/isMeteorBlockOnlyTest.js index 4eb7732..36fa238 100644 --- a/lib/util/executors/isMeteorBlockOnlyTest.js +++ b/lib/util/executors/isMeteorBlockOnlyTest.js @@ -1,4 +1,4 @@ -import { isMeteorProp } from '../ast'; +const { isMeteorProp } = require('../ast'); /** * Verifies a test of an IfStatement contains only checks with @@ -7,7 +7,7 @@ import { isMeteorProp } from '../ast'; * @param {node} test Test of an IfStatement (MemberExpression, LogicalExpression, UnaryExpression) * @return {Boolean} True if test contains only Meteor locus checks */ -export default function isMeteorBlockOnlyTest(test) { +module.exports = function isMeteorBlockOnlyTest(test) { switch (test.type) { case 'MemberExpression': return ( @@ -27,4 +27,4 @@ export default function isMeteorBlockOnlyTest(test) { default: return false; } -} +}; diff --git a/lib/util/executors/sets.js b/lib/util/executors/sets.js index f6450cf..68f80e8 100644 --- a/lib/util/executors/sets.js +++ b/lib/util/executors/sets.js @@ -1,22 +1,22 @@ -import invariant from 'invariant'; +const invariant = require('invariant'); // Set -> Set -> Set -export function difference(a, b) { +module.exports.difference = (a, b) => { invariant(!!a, 'difference: Set a is not defined'); invariant(!!b, 'difference: Set b is not defined'); return new Set([...a].filter(x => !b.has(x))); -} +}; // Set -> Set -> Set -export function union(a, b) { +module.exports.union = (a, b) => { invariant(!!a, 'union: Set a is not defined'); invariant(!!b, 'union: Set b is not defined'); return new Set([...a, ...b]); -} +}; // Set -> Set -> Set -export function intersection(a, b) { +module.exports.intersection = (a, b) => { invariant(!!a, 'intersection: Set a is not defined'); invariant(!!b, 'intersection: Set b is not defined'); return new Set([...a].filter(element => b.has(element))); -} +}; diff --git a/package-lock.json b/package-lock.json index b929aca..39b70bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -367,17 +367,6 @@ "integrity": "sha1-vgiVmQl7dKXJxKhKDNvNtivYeu8=", "dev": true }, - "anymatch": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", - "dev": true, - "optional": true, - "requires": { - "micromatch": "^2.1.5", - "normalize-path": "^2.0.0" - } - }, "argparse": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", @@ -403,16 +392,6 @@ "commander": "^2.11.0" } }, - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "optional": true, - "requires": { - "arr-flatten": "^1.0.1" - } - }, "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", @@ -462,13 +441,6 @@ "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", "dev": true }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true, - "optional": true - }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -511,13 +483,6 @@ "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, - "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", - "dev": true, - "optional": true - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -551,29 +516,6 @@ "ast-types-flow": "0.0.7" } }, - "babel-cli": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.26.0.tgz", - "integrity": "sha1-UCq1SHTX24itALiHoGODzgPQAvE=", - "dev": true, - "requires": { - "babel-core": "^6.26.0", - "babel-polyfill": "^6.26.0", - "babel-register": "^6.26.0", - "babel-runtime": "^6.26.0", - "chokidar": "^1.6.1", - "commander": "^2.11.0", - "convert-source-map": "^1.5.0", - "fs-readdir-recursive": "^1.0.0", - "glob": "^7.1.2", - "lodash": "^4.17.4", - "output-file-sync": "^1.1.2", - "path-is-absolute": "^1.0.1", - "slash": "^1.0.0", - "source-map": "^0.5.6", - "v8flags": "^2.1.1" - } - }, "babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", @@ -812,41 +754,18 @@ "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", "dev": true }, - "babel-plugin-syntax-async-generators": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz", - "integrity": "sha1-a8lj67FuzLrmuStZbrfzXDQqi5o=", - "dev": true - }, "babel-plugin-syntax-exponentiation-operator": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", "dev": true }, - "babel-plugin-syntax-object-rest-spread": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", - "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", - "dev": true - }, "babel-plugin-syntax-trailing-function-commas": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", "dev": true }, - "babel-plugin-transform-async-generator-functions": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz", - "integrity": "sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds=", - "dev": true, - "requires": { - "babel-helper-remap-async-to-generator": "^6.24.1", - "babel-plugin-syntax-async-generators": "^6.5.0", - "babel-runtime": "^6.22.0" - } - }, "babel-plugin-transform-async-to-generator": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", @@ -1103,16 +1022,6 @@ "babel-runtime": "^6.22.0" } }, - "babel-plugin-transform-object-rest-spread": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", - "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", - "dev": true, - "requires": { - "babel-plugin-syntax-object-rest-spread": "^6.8.0", - "babel-runtime": "^6.26.0" - } - }, "babel-plugin-transform-regenerator": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", @@ -1122,15 +1031,6 @@ "regenerator-transform": "^0.10.0" } }, - "babel-plugin-transform-runtime": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.23.0.tgz", - "integrity": "sha1-iEkNRGUC6puOfvsP4J7E2ZR5se4=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, "babel-plugin-transform-strict-mode": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", @@ -1198,51 +1098,6 @@ "semver": "^5.3.0" } }, - "babel-preset-es2015": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", - "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", - "dev": true, - "requires": { - "babel-plugin-check-es2015-constants": "^6.22.0", - "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoping": "^6.24.1", - "babel-plugin-transform-es2015-classes": "^6.24.1", - "babel-plugin-transform-es2015-computed-properties": "^6.24.1", - "babel-plugin-transform-es2015-destructuring": "^6.22.0", - "babel-plugin-transform-es2015-duplicate-keys": "^6.24.1", - "babel-plugin-transform-es2015-for-of": "^6.22.0", - "babel-plugin-transform-es2015-function-name": "^6.24.1", - "babel-plugin-transform-es2015-literals": "^6.22.0", - "babel-plugin-transform-es2015-modules-amd": "^6.24.1", - "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", - "babel-plugin-transform-es2015-modules-systemjs": "^6.24.1", - "babel-plugin-transform-es2015-modules-umd": "^6.24.1", - "babel-plugin-transform-es2015-object-super": "^6.24.1", - "babel-plugin-transform-es2015-parameters": "^6.24.1", - "babel-plugin-transform-es2015-shorthand-properties": "^6.24.1", - "babel-plugin-transform-es2015-spread": "^6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "^6.24.1", - "babel-plugin-transform-es2015-template-literals": "^6.22.0", - "babel-plugin-transform-es2015-typeof-symbol": "^6.22.0", - "babel-plugin-transform-es2015-unicode-regex": "^6.24.1", - "babel-plugin-transform-regenerator": "^6.24.1" - } - }, - "babel-preset-stage-3": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz", - "integrity": "sha1-g2raCp56f6N8sTj7kyb4eTSkg5U=", - "dev": true, - "requires": { - "babel-plugin-syntax-trailing-function-commas": "^6.22.0", - "babel-plugin-transform-async-generator-functions": "^6.24.1", - "babel-plugin-transform-async-to-generator": "^6.24.1", - "babel-plugin-transform-exponentiation-operator": "^6.24.1", - "babel-plugin-transform-object-rest-spread": "^6.22.0" - } - }, "babel-register": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", @@ -1405,13 +1260,6 @@ "integrity": "sha512-VOMDtYPwLbIncTxNoSzRyvaMxtXmLWLUqr8k5AfC1BzLk34HvBXaQX8snOwQZ4c0aX8aSERqtJSiI9/m2u5kuA==", "dev": true }, - "binary-extensions": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.10.0.tgz", - "integrity": "sha1-muuabF6IY4qtFx4Wf1kAq+JINdA=", - "dev": true, - "optional": true - }, "boom": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", @@ -1483,18 +1331,6 @@ "concat-map": "0.0.1" } }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "optional": true, - "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" - } - }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -1673,24 +1509,6 @@ "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", "dev": true }, - "chokidar": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", - "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", - "dev": true, - "optional": true, - "requires": { - "anymatch": "^1.3.0", - "async-each": "^1.0.0", - "fsevents": "^1.0.0", - "glob-parent": "^2.0.0", - "inherits": "^2.0.1", - "is-binary-path": "^1.0.0", - "is-glob": "^2.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.0.0" - } - }, "ci-info": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.0.0.tgz", @@ -1996,12 +1814,6 @@ "trim-off-newlines": "^1.0.0" } }, - "convert-source-map": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz", - "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=", - "dev": true - }, "copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", @@ -2832,26 +2644,6 @@ } } }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "optional": true, - "requires": { - "is-posix-bracket": "^0.1.0" - } - }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "dev": true, - "optional": true, - "requires": { - "fill-range": "^2.1.0" - } - }, "extend": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", @@ -2890,16 +2682,6 @@ "tmp": "^0.0.33" } }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "optional": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -3297,27 +3079,6 @@ "object-assign": "^4.0.1" } }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true, - "optional": true - }, - "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", - "dev": true, - "optional": true, - "requires": { - "is-number": "^2.1.0", - "isobject": "^2.0.0", - "randomatic": "^1.1.3", - "repeat-element": "^1.1.2", - "repeat-string": "^1.5.2" - } - }, "find-parent-dir": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/find-parent-dir/-/find-parent-dir-0.3.0.tgz", @@ -3349,1018 +3110,103 @@ "version": "0.1.5", "resolved": "https://registry.npmjs.org/findup/-/findup-0.1.5.tgz", "integrity": "sha1-itkpozk7rGJ5V6fl3kYjsGsOLOs=", - "dev": true, - "requires": { - "colors": "~0.6.0-1", - "commander": "~2.1.0" - }, - "dependencies": { - "colors": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", - "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", - "dev": true - }, - "commander": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz", - "integrity": "sha1-0SG7roYNmZKj1Re6lvVliOR8Z4E=", - "dev": true - } - } - }, - "flat-cache": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", - "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", - "dev": true, - "requires": { - "circular-json": "^0.3.1", - "del": "^2.0.2", - "graceful-fs": "^4.1.2", - "write": "^0.2.1" - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "optional": true, - "requires": { - "for-in": "^1.0.1" - } - }, - "foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "1.0.6", - "mime-types": "^2.1.12" - } - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, - "fs-extra": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.0.tgz", - "integrity": "sha512-lk2cUCo8QzbiEWEbt7Cw3m27WMiRG321xsssbcIpfMhpRjrlC08WBOVQqj1/nQYYNnPtyIhP1oqLO3QwT2tPCw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "fs-readdir-recursive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz", - "integrity": "sha1-jNF0XItPiinIyuw5JHaSG6GV9WA=", - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", - "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", - "dev": true, - "optional": true, - "requires": { - "nan": "^2.3.0", - "node-pre-gyp": "^0.6.36" - }, - "dependencies": { - "abbrev": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "ajv": { - "version": "4.11.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "co": "^4.6.0", - "json-stable-stringify": "^1.0.1" - } - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "asn1": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "optional": true - }, - "assert-plus": { - "version": "0.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "asynckit": { - "version": "0.4.0", - "bundled": true, - "dev": true, - "optional": true - }, - "aws-sign2": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "aws4": { - "version": "1.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "balanced-match": { - "version": "0.4.2", - "bundled": true, - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "block-stream": { - "version": "0.0.9", - "bundled": true, - "dev": true, - "requires": { - "inherits": "~2.0.0" - } - }, - "boom": { - "version": "2.10.1", - "bundled": true, - "dev": true, - "requires": { - "hoek": "2.x.x" - } - }, - "brace-expansion": { - "version": "1.1.7", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^0.4.1", - "concat-map": "0.0.1" - } - }, - "buffer-shims": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "caseless": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true - }, - "co": { - "version": "4.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "combined-stream": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "cryptiles": { - "version": "2.0.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "boom": "2.x.x" - } - }, - "dashdash": { - "version": "1.14.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "^1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "debug": { - "version": "2.6.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.4.2", - "bundled": true, - "dev": true, - "optional": true - }, - "delayed-stream": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "ecc-jsbn": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsbn": "~0.1.0" - } - }, - "extend": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "extsprintf": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "optional": true - }, - "form-data": { - "version": "2.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.5", - "mime-types": "^2.1.12" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "fstream": { - "version": "1.0.11", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, - "fstream-ignore": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fstream": "^1.0.0", - "inherits": "2", - "minimatch": "^3.0.0" - } - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "getpass": { - "version": "0.1.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "^1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.1.11", - "bundled": true, - "dev": true - }, - "har-schema": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "optional": true - }, - "har-validator": { - "version": "4.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ajv": "^4.9.1", - "har-schema": "^1.0.5" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "hawk": { - "version": "3.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "boom": "2.x.x", - "cryptiles": "2.x.x", - "hoek": "2.x.x", - "sntp": "1.x.x" - } - }, - "hoek": { - "version": "2.16.3", - "bundled": true, - "dev": true - }, - "http-signature": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "^0.2.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.4", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-typedarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "isstream": { - "version": "0.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "jodid25519": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsbn": "~0.1.0" - } - }, - "jsbn": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "json-schema": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "optional": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsonify": "~0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "jsonify": { - "version": "0.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "jsprim": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.0.2", - "json-schema": "0.2.3", - "verror": "1.3.6" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "mime-db": { - "version": "1.27.0", - "bundled": true, - "dev": true - }, - "mime-types": { - "version": "2.1.15", - "bundled": true, - "dev": true, - "requires": { - "mime-db": "~1.27.0" - } - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "node-pre-gyp": { - "version": "0.6.36", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "mkdirp": "^0.5.1", - "nopt": "^4.0.1", - "npmlog": "^4.0.2", - "rc": "^1.1.7", - "request": "^2.81.0", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^2.2.1", - "tar-pack": "^3.4.0" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npmlog": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "oauth-sign": { - "version": "0.8.2", - "bundled": true, - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "performance-now": { - "version": "0.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "1.0.7", - "bundled": true, - "dev": true - }, - "punycode": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true - }, - "qs": { - "version": "6.4.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "~0.4.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.2.9", - "bundled": true, - "dev": true, - "requires": { - "buffer-shims": "~1.0.0", - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "~1.0.0", - "process-nextick-args": "~1.0.6", - "string_decoder": "~1.0.0", - "util-deprecate": "~1.0.1" - } - }, - "request": { - "version": "2.81.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aws-sign2": "~0.6.0", - "aws4": "^1.2.1", - "caseless": "~0.12.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.0", - "forever-agent": "~0.6.1", - "form-data": "~2.1.1", - "har-validator": "~4.2.1", - "hawk": "~3.1.3", - "http-signature": "~1.1.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.7", - "oauth-sign": "~0.8.1", - "performance-now": "^0.2.0", - "qs": "~6.4.0", - "safe-buffer": "^5.0.1", - "stringstream": "~0.0.4", - "tough-cookie": "~2.3.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.0.0" - } - }, - "rimraf": { - "version": "2.6.1", - "bundled": true, - "dev": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-buffer": { - "version": "5.0.1", - "bundled": true, - "dev": true - }, - "semver": { - "version": "5.3.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sntp": { - "version": "1.0.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "hoek": "2.x.x" - } - }, - "sshpk": { - "version": "1.13.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jodid25519": "^1.0.0", - "jsbn": "~0.1.0", - "tweetnacl": "~0.14.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "stringstream": { - "version": "0.0.5", - "bundled": true, - "dev": true, - "optional": true - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "block-stream": "*", - "fstream": "^1.0.2", - "inherits": "2" - } - }, - "tar-pack": { - "version": "3.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^2.2.0", - "fstream": "^1.0.10", - "fstream-ignore": "^1.0.5", - "once": "^1.3.3", - "readable-stream": "^2.1.4", - "rimraf": "^2.5.1", - "tar": "^2.2.1", - "uid-number": "^0.0.6" - } - }, - "tough-cookie": { - "version": "2.3.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "punycode": "^1.4.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "bundled": true, - "dev": true, - "optional": true - }, - "uid-number": { - "version": "0.0.6", - "bundled": true, - "dev": true, - "optional": true - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "uuid": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "verror": { - "version": "1.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "extsprintf": "1.0.2" - } - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2" - } + "dev": true, + "requires": { + "colors": "~0.6.0-1", + "commander": "~2.1.0" + }, + "dependencies": { + "colors": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", + "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", + "dev": true }, - "wrappy": { - "version": "1.0.2", - "bundled": true, + "commander": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz", + "integrity": "sha1-0SG7roYNmZKj1Re6lvVliOR8Z4E=", "dev": true } } }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "^0.3.1", + "del": "^2.0.2", + "graceful-fs": "^4.1.2", + "write": "^0.2.1" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "fs-extra": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.0.tgz", + "integrity": "sha512-lk2cUCo8QzbiEWEbt7Cw3m27WMiRG321xsssbcIpfMhpRjrlC08WBOVQqj1/nQYYNnPtyIhP1oqLO3QwT2tPCw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -4465,26 +3311,6 @@ "path-is-absolute": "^1.0.0" } }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "optional": true, - "requires": { - "glob-parent": "^2.0.0", - "is-glob": "^2.0.0" - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, "glob-to-regexp": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", @@ -5003,16 +3829,6 @@ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "optional": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, "is-buffer": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", @@ -5083,35 +3899,12 @@ "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", "dev": true }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true, - "optional": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "optional": true, - "requires": { - "is-primitive": "^2.0.0" - } - }, "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", "dev": true }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, "is-finite": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", @@ -5127,15 +3920,6 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, "is-installed-globally": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", @@ -5152,16 +3936,6 @@ "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=", "dev": true }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } - }, "is-obj": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", @@ -5238,19 +4012,6 @@ } } }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true, - "optional": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", @@ -5344,16 +4105,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "optional": true, - "requires": { - "isarray": "1.0.0" - } - }, "isomorphic-fetch": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", @@ -5822,28 +4573,6 @@ "integrity": "sha512-bgM8twH86rWni21thii6WCMQMRMmwqqdW3sGWi9IipnVAszdLXRjwDwAnyrVXo6DuP3AjRMMttZKUB48QWIFGg==", "dev": true }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "optional": true, - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" - } - }, "mime": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz", @@ -5995,13 +4724,6 @@ "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "dev": true }, - "nan": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.6.2.tgz", - "integrity": "sha1-5P805slf37WuzAjeZZb0NgWn20U=", - "dev": true, - "optional": true - }, "nanomatch": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", @@ -6091,15 +4813,6 @@ "validate-npm-package-license": "^3.0.1" } }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, "normalize-url": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz", @@ -8465,17 +7178,6 @@ } } }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "optional": true, - "requires": { - "for-own": "^0.1.4", - "is-extendable": "^0.1.1" - } - }, "object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", @@ -8583,17 +7285,6 @@ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, - "output-file-sync": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz", - "integrity": "sha1-0KM+7+YaIF+suQCS6CZZjVJFznY=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.4", - "mkdirp": "^0.5.1", - "object-assign": "^4.1.0" - } - }, "p-cancelable": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz", @@ -8726,19 +7417,6 @@ "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==", "dev": true }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "optional": true, - "requires": { - "glob-base": "^0.3.0", - "is-dotfile": "^1.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.0" - } - }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -8869,13 +7547,6 @@ "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", "dev": true }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true, - "optional": true - }, "prettier": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.12.1.tgz", @@ -8967,51 +7638,6 @@ "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", "dev": true }, - "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", - "dev": true, - "optional": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "rc": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.5.tgz", @@ -9079,19 +7705,6 @@ "util-deprecate": "~1.0.1" } }, - "readdirp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", - "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.2", - "minimatch": "^3.0.2", - "readable-stream": "^2.0.2", - "set-immediate-shim": "^1.0.1" - } - }, "readline-sync": { "version": "1.4.9", "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.9.tgz", @@ -9148,17 +7761,6 @@ "private": "^0.1.6" } }, - "regex-cache": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", - "integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=", - "dev": true, - "optional": true, - "requires": { - "is-equal-shallow": "^0.1.3", - "is-primitive": "^2.0.0" - } - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -9228,12 +7830,6 @@ } } }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, "repeat-element": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", @@ -9596,13 +8192,6 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", - "dev": true, - "optional": true - }, "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", @@ -10557,12 +9146,6 @@ } } }, - "user-home": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", - "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=", - "dev": true - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -10575,15 +9158,6 @@ "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", "dev": true }, - "v8flags": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", - "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", - "dev": true, - "requires": { - "user-home": "^1.1.1" - } - }, "validate-commit-msg": { "version": "2.14.0", "resolved": "https://registry.npmjs.org/validate-commit-msg/-/validate-commit-msg-2.14.0.tgz", diff --git a/package.json b/package.json index e3dc713..9f5f8e2 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.0-development", "author": "Dominik Ferber ", "description": "Meteor specific linting rules for ESLint", - "main": "dist/index.js", + "main": "lib/index.js", "publishConfig": { "tag": "next" }, @@ -11,26 +11,21 @@ "branch": "master" }, "scripts": { - "build": "babel lib -d dist", - "build:w": "npm run build -- --watch", "coverage:check": "nyc check-coverage --lines 100 --functions 100 --branches 100", "coverage:report": "nyc report", - "clean": "rimraf dist", "coveralls": "cat ./coverage/lcov.info | coveralls", "format": "prettier --write 'lib/**/*.js' 'tests/**/*.js' 'scripts/**/*.js'", "lint": "eslint ./", - "prebuild": "npm run clean && mkdir dist", - "prepublishOnly": "npm run build", "pretest": "npm run lint", - "rule": "babel scripts/new-rule.js | node", + "rule": "node scripts/new-rule.js", "test": "npm run unit-test && npm run coverage:report && npm run coverage:check", - "unit-test": "nyc --require=babel-register --reporter=lcov mocha tests --recursive", - "unit-test:w": "npm run unit-test -s -- --watch" + "unit-test": "nyc --reporter=lcov mocha tests --recursive", + "unit-test:watch": "npm run unit-test -s -- --watch" }, "files": [ "LICENSE", "README.md", - "dist" + "lib" ], "repository": { "type": "git", @@ -42,13 +37,6 @@ "invariant": "2.2.4" }, "devDependencies": { - "babel-cli": "~6.26.0", - "babel-core": "6.26.3", - "babel-plugin-transform-object-rest-spread": "~6.26.0", - "babel-plugin-transform-runtime": "~6.23.0", - "babel-preset-es2015": "~6.24.1", - "babel-preset-stage-3": "~6.24.1", - "babel-register": "~6.26.0", "colors": "~1.2.0", "coveralls": "3.0.1", "cz-conventional-changelog": "~2.1.0", @@ -64,7 +52,6 @@ "nyc": "~11.7.1", "prettier": "~1.12.0", "readline-sync": "~1.4.9", - "rimraf": "~2.6.2", "semantic-release": "~15.4.0", "travis-deploy-once": "4.4.1", "validate-commit-msg": "~2.14.0" diff --git a/scripts/new-rule.js b/scripts/new-rule.js index 1e26cb8..378ec31 100644 --- a/scripts/new-rule.js +++ b/scripts/new-rule.js @@ -61,25 +61,28 @@ const rule = `/** * See LICENSE file in root directory for full license. */ -export default (context) => { - // --------------------------------------------------------------------------- - // Helpers - // --------------------------------------------------------------------------- - // any helper functions should go here or else delete this section + module.exports = { + meta: { + schema: [], + }, + create: (context) => { + // --------------------------------------------------------------------------- + // Helpers + // --------------------------------------------------------------------------- - // --------------------------------------------------------------------------- - // Public - // --------------------------------------------------------------------------- + // any helper functions should go here or else delete this section - return { - // give me methods - } -} + // --------------------------------------------------------------------------- + // Public + // --------------------------------------------------------------------------- + + return { + // give me methods + } + } + } -export const schema = [ - // fill in your schema -] `; @@ -90,8 +93,8 @@ const test = `/** * See LICENSE file in root directory for full license. */ -import { RuleTester } from 'eslint' -import rule from '../../../lib/rules/${ruleId}' +const { RuleTester } = require('eslint') +const rule = require('../../../lib/rules/${ruleId}') const ruleTester = new RuleTester() diff --git a/tests/index.js b/tests/index.js index 6b4fe75..c93ff3f 100755 --- a/tests/index.js +++ b/tests/index.js @@ -1,7 +1,7 @@ -import assert from 'assert'; -import fs from 'fs'; -import path from 'path'; -import { rules, configs } from '../lib/index'; +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); +const { rules, configs } = require('../lib/index'); const ruleNames = fs .readdirSync(path.resolve(__dirname, '../lib/rules/')) diff --git a/tests/lib/rules/audit-argument-checks.js b/tests/lib/rules/audit-argument-checks.js index d318881..e58703d 100644 --- a/tests/lib/rules/audit-argument-checks.js +++ b/tests/lib/rules/audit-argument-checks.js @@ -7,8 +7,8 @@ // Requirements // ----------------------------------------------------------------------------- -import { RuleTester } from 'eslint'; -import rule from '../../../lib/rules/audit-argument-checks'; +const { RuleTester } = require('eslint'); +const rule = require('../../../lib/rules/audit-argument-checks'); // ----------------------------------------------------------------------------- // Tests diff --git a/tests/lib/rules/eventmap-params.js b/tests/lib/rules/eventmap-params.js index fbf4bb7..e1a7b54 100644 --- a/tests/lib/rules/eventmap-params.js +++ b/tests/lib/rules/eventmap-params.js @@ -9,8 +9,8 @@ // Requirements // ----------------------------------------------------------------------------- -import { RuleTester } from 'eslint'; -import rule from '../../../lib/rules/eventmap-params'; +const { RuleTester } = require('eslint'); +const rule = require('../../../lib/rules/eventmap-params'); // ----------------------------------------------------------------------------- // Tests diff --git a/tests/lib/rules/no-dom-lookup-on-created.js b/tests/lib/rules/no-dom-lookup-on-created.js index 4f61972..3e3575d 100644 --- a/tests/lib/rules/no-dom-lookup-on-created.js +++ b/tests/lib/rules/no-dom-lookup-on-created.js @@ -5,8 +5,8 @@ * See LICENSE file in root directory for full license. */ -import { RuleTester } from 'eslint'; -import rule from '../../../lib/rules/no-dom-lookup-on-created'; +const { RuleTester } = require('eslint'); +const rule = require('../../../lib/rules/no-dom-lookup-on-created'); const ruleTester = new RuleTester(); diff --git a/tests/lib/rules/no-session.js b/tests/lib/rules/no-session.js index 062427b..6dee74f 100644 --- a/tests/lib/rules/no-session.js +++ b/tests/lib/rules/no-session.js @@ -9,8 +9,8 @@ // Requirements // ----------------------------------------------------------------------------- -import { RuleTester } from 'eslint'; -import rule from '../../../lib/rules/no-session'; +const { RuleTester } = require('eslint'); +const rule = require('../../../lib/rules/no-session'); // ----------------------------------------------------------------------------- // Tests diff --git a/tests/lib/rules/no-template-lifecycle-assignments.js b/tests/lib/rules/no-template-lifecycle-assignments.js index bbd04fb..a70b147 100644 --- a/tests/lib/rules/no-template-lifecycle-assignments.js +++ b/tests/lib/rules/no-template-lifecycle-assignments.js @@ -9,8 +9,8 @@ // Requirements // ----------------------------------------------------------------------------- -import { RuleTester } from 'eslint'; -import rule from '../../../lib/rules/no-template-lifecycle-assignments'; +const { RuleTester } = require('eslint'); +const rule = require('../../../lib/rules/no-template-lifecycle-assignments'); // ----------------------------------------------------------------------------- // Tests diff --git a/tests/lib/rules/no-template-parent-data.js b/tests/lib/rules/no-template-parent-data.js index f7783b4..cba9c5e 100644 --- a/tests/lib/rules/no-template-parent-data.js +++ b/tests/lib/rules/no-template-parent-data.js @@ -5,8 +5,8 @@ * See LICENSE file in root directory for full license. */ -import { RuleTester } from 'eslint'; -import rule from '../../../lib/rules/no-template-parent-data'; +const { RuleTester } = require('eslint'); +const rule = require('../../../lib/rules/no-template-parent-data'); const ruleTester = new RuleTester(); diff --git a/tests/lib/rules/no-zero-timeout.js b/tests/lib/rules/no-zero-timeout.js index 5048696..7cf5070 100644 --- a/tests/lib/rules/no-zero-timeout.js +++ b/tests/lib/rules/no-zero-timeout.js @@ -7,8 +7,8 @@ // Requirements // ----------------------------------------------------------------------------- -import { RuleTester } from 'eslint'; -import rule from '../../../lib/rules/no-zero-timeout'; +const { RuleTester } = require('eslint'); +const rule = require('../../../lib/rules/no-zero-timeout'); // ----------------------------------------------------------------------------- // Tests diff --git a/tests/lib/rules/prefer-session-equals.js b/tests/lib/rules/prefer-session-equals.js index 0949848..f16e97e 100644 --- a/tests/lib/rules/prefer-session-equals.js +++ b/tests/lib/rules/prefer-session-equals.js @@ -9,8 +9,8 @@ // Requirements // ----------------------------------------------------------------------------- -import { RuleTester } from 'eslint'; -import rule from '../../../lib/rules/prefer-session-equals'; +const { RuleTester } = require('eslint'); +const rule = require('../../../lib/rules/prefer-session-equals'); const ruleTester = new RuleTester(); diff --git a/tests/lib/rules/prefix-eventmap-selectors.js b/tests/lib/rules/prefix-eventmap-selectors.js index 58c0737..237f15e 100644 --- a/tests/lib/rules/prefix-eventmap-selectors.js +++ b/tests/lib/rules/prefix-eventmap-selectors.js @@ -5,8 +5,8 @@ * See LICENSE file in root directory for full license. */ -import { RuleTester } from 'eslint'; -import rule from '../../../lib/rules/prefix-eventmap-selectors'; +const { RuleTester } = require('eslint'); +const rule = require('../../../lib/rules/prefix-eventmap-selectors'); const ruleTester = new RuleTester(); diff --git a/tests/lib/rules/scope-dom-lookups.js b/tests/lib/rules/scope-dom-lookups.js index 48600cd..7d4ccaa 100644 --- a/tests/lib/rules/scope-dom-lookups.js +++ b/tests/lib/rules/scope-dom-lookups.js @@ -5,8 +5,8 @@ * See LICENSE file in root directory for full license. */ -import { RuleTester } from 'eslint'; -import rule from '../../../lib/rules/scope-dom-lookups'; +const { RuleTester } = require('eslint'); +const rule = require('../../../lib/rules/scope-dom-lookups'); const ruleTester = new RuleTester(); diff --git a/tests/lib/rules/template-names.js b/tests/lib/rules/template-names.js index 1d751c7..42d4ef3 100644 --- a/tests/lib/rules/template-names.js +++ b/tests/lib/rules/template-names.js @@ -9,8 +9,8 @@ // Requirements // ----------------------------------------------------------------------------- -import { RuleTester } from 'eslint'; -import rule from '../../../lib/rules/template-names'; +const { RuleTester } = require('eslint'); +const rule = require('../../../lib/rules/template-names'); const ruleTester = new RuleTester(); diff --git a/tests/lib/util/ast/getPropertyName.js b/tests/lib/util/ast/getPropertyName.js index 6d14928..e6e7e9a 100644 --- a/tests/lib/util/ast/getPropertyName.js +++ b/tests/lib/util/ast/getPropertyName.js @@ -1,5 +1,5 @@ -import assert from 'assert'; -import getPropertyName from '../../../../lib/util/ast/getPropertyName'; +const assert = require('assert'); +const getPropertyName = require('../../../../lib/util/ast/getPropertyName'); describe('getPropertyName', () => { it('returns false if property type is not Literal or Identifier', () => { diff --git a/tests/lib/util/ast/index.js b/tests/lib/util/ast/index.js index 43e45aa..b4ff081 100644 --- a/tests/lib/util/ast/index.js +++ b/tests/lib/util/ast/index.js @@ -1,5 +1,5 @@ -import assert from 'assert'; -import * as astUtils from '../../../../lib/util/ast/index'; +const assert = require('assert'); +const astUtils = require('../../../../lib/util/ast/index'); describe('ast utils', () => { it('exports isMeteorCall', () => { diff --git a/tests/lib/util/ast/isMeteorCall.js b/tests/lib/util/ast/isMeteorCall.js index 03f3334..9b8c5e2 100644 --- a/tests/lib/util/ast/isMeteorCall.js +++ b/tests/lib/util/ast/isMeteorCall.js @@ -1,5 +1,5 @@ -import assert from 'assert'; -import isMeteorCall from '../../../../lib/util/ast/isMeteorCall'; +const assert = require('assert'); +const isMeteorCall = require('../../../../lib/util/ast/isMeteorCall'); describe('isMeteorCall', () => { it('returns true if node is a Meteor call', () => { diff --git a/tests/lib/util/executors/filterExecutorsByAncestors.js b/tests/lib/util/executors/filterExecutorsByAncestors.js index f08ba0d..d2bd23e 100644 --- a/tests/lib/util/executors/filterExecutorsByAncestors.js +++ b/tests/lib/util/executors/filterExecutorsByAncestors.js @@ -1,5 +1,5 @@ -import assert from 'assert'; -import filterExecutorsByAncestors from '../../../../lib/util/executors/filterExecutorsByAncestors'; +const assert = require('assert'); +const filterExecutorsByAncestors = require('../../../../lib/util/executors/filterExecutorsByAncestors'); describe('filterExecutorsByAncestors', () => { it('filters on MemberExpression for isClient', () => { diff --git a/tests/lib/util/executors/getExecutors.js b/tests/lib/util/executors/getExecutors.js index d69d598..b89c12e 100644 --- a/tests/lib/util/executors/getExecutors.js +++ b/tests/lib/util/executors/getExecutors.js @@ -1,6 +1,6 @@ -import assert from 'assert'; -import getExecutors from '../../../../lib/util/executors/getExecutors'; -import { UNIVERSAL } from '../../../../lib/util/environment'; +const assert = require('assert'); +const getExecutors = require('../../../../lib/util/executors/getExecutors'); +const { UNIVERSAL } = require('../../../../lib/util/environment'); describe('getExecutors', () => { it('returns executors for no ancestors', () => { diff --git a/tests/lib/util/executors/getExecutorsByEnv.js b/tests/lib/util/executors/getExecutorsByEnv.js index 1f63b00..3368cdd 100644 --- a/tests/lib/util/executors/getExecutorsByEnv.js +++ b/tests/lib/util/executors/getExecutorsByEnv.js @@ -1,7 +1,7 @@ -import assert from 'assert'; -import getExecutorsByEnv from '../../../../lib/util/executors/getExecutorsByEnv'; +const assert = require('assert'); +const getExecutorsByEnv = require('../../../../lib/util/executors/getExecutorsByEnv'); -import { +const { PUBLIC, PRIVATE, CLIENT, @@ -14,7 +14,7 @@ import { MOBILE_CONFIG, COMPATIBILITY, NON_METEOR, -} from '../../../../lib/util/environment'; +} = require('../../../../lib/util/environment'); describe('getExecutorsByEnv', () => { it('public', () => { diff --git a/tests/lib/util/executors/getExecutorsFromTest.js b/tests/lib/util/executors/getExecutorsFromTest.js index d7bbb18..be7b714 100644 --- a/tests/lib/util/executors/getExecutorsFromTest.js +++ b/tests/lib/util/executors/getExecutorsFromTest.js @@ -1,5 +1,5 @@ -import assert from 'assert'; -import getExecutorsFromTest from '../../../../lib/util/executors/getExecutorsFromTest'; +const assert = require('assert'); +const getExecutorsFromTest = require('../../../../lib/util/executors/getExecutorsFromTest'); describe('getExecutorsFromTest', () => { it('throws for unkown type', () => { diff --git a/tests/lib/util/executors/isMeteorBlockOnlyTest.js b/tests/lib/util/executors/isMeteorBlockOnlyTest.js index 85e706e..f9ebf83 100644 --- a/tests/lib/util/executors/isMeteorBlockOnlyTest.js +++ b/tests/lib/util/executors/isMeteorBlockOnlyTest.js @@ -1,5 +1,5 @@ -import assert from 'assert'; -import isMeteorBlockOnlyTest from '../../../../lib/util/executors/isMeteorBlockOnlyTest'; +const assert = require('assert'); +const isMeteorBlockOnlyTest = require('../../../../lib/util/executors/isMeteorBlockOnlyTest'); describe('isMeteorBlockOnlyTest', () => { it('accepts a valid MemberExpression', () => { diff --git a/tests/lib/util/executors/sets.js b/tests/lib/util/executors/sets.js index 29c403f..0f1a82e 100644 --- a/tests/lib/util/executors/sets.js +++ b/tests/lib/util/executors/sets.js @@ -1,9 +1,9 @@ -import assert from 'assert'; -import { +const assert = require('assert'); +const { difference, union, intersection, -} from '../../../../lib/util/executors/sets'; +} = require('../../../../lib/util/executors/sets'); describe('executors', () => { describe('union', () => {