Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
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
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',
],
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 }})',
},