0.0.3 • Published 5 years ago

eslint-worker-brunch v0.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

eslint-worker-brunch

Inspired by eslint-brunch

Adds ESLint support to Brunch.

Usage

Install the plugin via npm with npm install --save-dev eslint-worker-brunch.

Configuration settings can be set in any acceptable .eslintrc.* configuration file formats. If no configuration file can be found, this plugin will fallback to default ESLint options.

const sysPath = require("path");
exports.plugins = {
  eslint: {
    workers: require("os").cpus().length >> 1,
    config: {
      rules: {semi: 'always'},
    },
    overrides: {
      "*.coffee": ({data, path, map}) => {
        const basename = sysPath.basename(path, sysPath.extname(path));

        return {
          rules: {
            "no-unused-vars": [2, {
              "vars": "all"
              "args": "none"
              "caughtErrors": "none"
              "varsIgnorePattern": basename
            }]
          }
        };
      },
      "*.fbs": {
        rules: {
          "no-use-before-define": 0
          "no-invalid-this": 0
          "no-magic-numbers": 0
        }
      }
    },
    ignore: /^(?:bower_components|vendor)[/\\]/,
    pattern: /^src\/.*\.jsx?$/,
    warnOnly: false,
    formatter: 'table',
  },
};

Options

OptionTypeOptionalDefaultDescription
workersIntegerYesundefinedNumber of workers to use for linting. Usefull to get large project linted faster
configObjectYesundefinedOptions to pass to the ESLint engine (docs)
overridesObjectYesundefinedOverrides eslint config per file pattern
patternRegExpYes/^app\/.*\.jsx?$/Pattern of file paths to be processed (docs)
warnOnlyBooleanYestrueUse warn logging level instead of error
formatterStringYes'stylish'Built-in formatter to use (docs)