How to use the @strv/eslint-config-base.settings function in @strv/eslint-config-base

To help you get started, we’ve selected a few @strv/eslint-config-base examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github strvcom / code-quality-tools / packages / eslint-config-node / index.js View on Github external
},

  env: {
    es6: true,
    node: true,
  },

  plugins: [
    'node',
  ],

  settings: {
    'import/resolver': {
      node: {
        extensions: [
          ...base.settings['import/resolver'].node.extensions,
          '.node',
        ],
      },
    },
  },

  rules: {
    // Enforce `require()` on the top-level module scope
    // It's arguably harder to identify dependencies when they are deeply nested inside of functions
    // and other statements. Since require() does a synchronous load, it can cause performance
    // problems when used in other locations.
    'global-require': 'warn',

    // Disallow use of the deprecated Buffer() constructor
    // In Node.js, the behavior of the Buffer constructor is different depending on the type of its
    // argument. Passing an argument from user input to Buffer() without validating its type can
github strvcom / code-quality-tools / packages / eslint-config-typescript / index.js View on Github external
const base = require('@strv/eslint-config-base')

module.exports = {

  extends: require.resolve('@strv/eslint-config-base'),

  settings: {
    // Correctly recognise .ts and .d.ts files when checking import paths against the filesystem
    'import/resolver': {
      node: {
        extensions: [
          '.ts',
          '.tsx',
          '.d.ts',
          ...base.settings['import/resolver'].node.extensions,
        ],
      },
    },
  },

  parser: '@typescript-eslint/parser',

  parserOptions: {
    ecmaVersion: 2018,
    sourceType: 'module',
  },

  plugins: [
    '@typescript-eslint',
  ],
github strvcom / code-quality-tools / packages / eslint-config-react / index.js View on Github external
sourceType: 'module',
    ecmaFeatures: {
      jsx: true,
    },
  },

  settings: {
    react: {
      version: 'detect',
    },

    'import/resolver': {
      node: {
        extensions: [
          '.jsx',
          ...base.settings['import/resolver'].node.extensions,
        ],
      },
    },
  },

  /* eslint-disable max-len */
  rules: {
    // Enforces consistent naming for boolean props
    // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/boolean-prop-naming.md
    'react/boolean-prop-naming': [
      'warn',
      {
        rule: '^(is|has)[A-Z]([A-Za-z0-9]?)+',
        message:
          'Boolean prop: ({{ propName }}) should start with is/has - pattern: ({{ pattern }})',
      },

@strv/eslint-config-base

STRV's ESLint configuration preset

BSD-3-Clause
Latest version published 10 months ago

Package Health Score

67 / 100
Full package analysis