<commit_before>/* eslint-disable no-console */

var fs = require('fs')
var readlineSync = require('readline-sync')
var colors = require('colors/safe')

console.log('Scaffolding new rule. Please give the following details.')
var authorName = readlineSync.question(colors.green('What is your name? '))
var ruleId = readlineSync.question(colors.green('What is the rule ID? '))
var desc = readlineSync.question(colors.green('Type a short description of this rule: '))
var failingExample = readlineSync.question(colors.green('Type a short example of the code that will fail: '))
var escapedFailingExample = failingExample.replace(`'`, `\\'`)

var doc = `# ${desc} (${ruleId})

Please describe the origin of the rule here.


## Rule Details

This rule aims to...

The following patterns are considered warnings:

\`\`\`js

// fill me in

\`\`\`

The following patterns are not warnings:

\`\`\`js

// fill me in

\`\`\`

### Options

If there are any options, describe them here. Otherwise, delete this section.

## When Not To Use It

Give a short description of when it would be appropriate to turn off this rule.

## Further Reading

If there are other links that describe the issue this rule addresses, please include them here in a bulleted list.

`


var rule = `/**
 * @fileoverview ${desc}
 * @author ${authorName}
 * @copyright 2015 ${authorName}. All rights reserved.
 * See LICENSE file in root directory for full license.
 */

// -----------------------------------------------------------------------------
// Rule Definition
// -----------------------------------------------------------------------------

module.exports = (/* getMeta */) => (/* context */) => {

  // variables should be defined here

  // ---------------------------------------------------------------------------
  // Helpers
  // ---------------------------------------------------------------------------

  // any helper functions should go here or else delete this section

  // ---------------------------------------------------------------------------
  // Public
  // ---------------------------------------------------------------------------

  return {

    // give me methods

  }

}

module.exports.schema = [
  // fill in your schema
]

`

var test = `/**
 * @fileoverview ${desc}
 * @author ${authorName}
 * @copyright 2015 ${authorName}. All rights reserved.
 * See LICENSE file in root directory for full license.
 */

// -----------------------------------------------------------------------------
// Requirements
// -----------------------------------------------------------------------------

import { CLIENT, SERVER } from '../../../dist/util/environment.js'
var rule = require('../../../dist/rules/${ruleId}')
var RuleTester = require('eslint').RuleTester


// -----------------------------------------------------------------------------
// Environments
// -----------------------------------------------------------------------------

const serverEnv = {
  path: 'server/${ruleId}.js',
  env: CLIENT
  isCompatibilityFile: false,
  isInMeteorProject: true,
  isPackageConfig: false,
  isMobileConfig: false
}

const clientEnv = {
  path: 'server/${ruleId}.js',
  env: CLIENT<commit_msg>chore(scaffolding): Remove syntax error in scaffolded rule<commit_after>/* eslint-disable no-console */

var fs = require('fs')
var readlineSync = require('readline-sync')
var colors = require('colors/safe')

console.log('Scaffolding new rule. Please give the following details.')
var authorName = readlineSync.question(colors.green('What is your name? '))
var ruleId = readlineSync.question(colors.green('What is the rule ID? '))
var desc = readlineSync.question(colors.green('Type a short description of this rule: '))
var failingExample = readlineSync.question(colors.green('Type a short example of the code that will fail: '))
var escapedFailingExample = failingExample.replace(`'`, `\\'`)

var doc = `# ${desc} (${ruleId})

Please describe the origin of the rule here.


## Rule Details

This rule aims to...

The following patterns are considered warnings:

\`\`\`js

// fill me in

\`\`\`

The following patterns are not warnings:

\`\`\`js

// fill me in

\`\`\`

### Options

If there are any options, describe them here. Otherwise, delete this section.

## When Not To Use It

Give a short description of when it would be appropriate to turn off this rule.

## Further Reading

If there are other links that describe the issue this rule addresses, please include them here in a bulleted list.

`


var rule = `/**
 * @fileoverview ${desc}
 * @author ${authorName}
 * @copyright 2015 ${authorName}. All rights reserved.
 * See LICENSE file in root directory for full license.
 */

// -----------------------------------------------------------------------------
// Rule Definition
// -----------------------------------------------------------------------------

module.exports = (/* getMeta */) => (/* context */) => {

  // variables should be defined here

  // ---------------------------------------------------------------------------
  // Helpers
  // ---------------------------------------------------------------------------

  // any helper functions should go here or else delete this section

  // ---------------------------------------------------------------------------
  // Public
  // ---------------------------------------------------------------------------

  return {

    // give me methods

  }

}

module.exports.schema = [
  // fill in your schema
]

`

var test = `/**
 * @fileoverview ${desc}
 * @author ${authorName}
 * @copyright 2015 ${authorName}. All rights reserved.
 * See LICENSE file in root directory for full license.
 */

// -----------------------------------------------------------------------------
// Requirements
// -----------------------------------------------------------------------------

import { CLIENT, SERVER } from '../../../dist/util/environment.js'
var rule = require('../../../dist/rules/${ruleId}')
var RuleTester = require('eslint').RuleTester


// -----------------------------------------------------------------------------
// Environments
// -----------------------------------------------------------------------------

const serverEnv = {
  path: 'server/${ruleId}.js',
  env: SERVER,
  isCompatibilityFile: false,
  isInMeteorProject: true,
  isPackageConfig: false,
  isMobileConfig: false
}

const clientEnv = {
  path: 'server/${ruleId}.js',
  env: CLIENT,
{'fraction_non_alphanumeric': 0.3434924584046027, 'fraction_numerical': 0.0024879489970455605, 'mean_word_length': 1.4080868588543616, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '766481', 'n_tokens_mistral': 1551, 'n_tokens_neox': 1503, 'n_words': 519}