@jenssimon/eslint-config-sfcc
Version:
A collection of shareable ESLint configurations for Salesforce Commerce Cloud (SFCC)
124 lines (118 loc) • 3.51 kB
JavaScript
const sfccGlobals = require('./sfcc-globals')
module.exports = {
parser: '@babel/eslint-parser',
parserOptions: {
requireConfigFile: false,
},
plugins: [
'sitegenesis',
'es5',
],
extends: [
'@jenssimon/base',
],
env: {
commonjs: true,
es6: true,
browser: false,
},
globals: sfccGlobals,
rules: {
'comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
}],
'consistent-return': 'off',
'es5/no-arrow-functions': 'off',
'es5/no-binary-and-octal-literals': 'error',
'es5/no-block-scoping': 'off',
'es5/no-classes': 'error',
'es5/no-computed-properties': 'error',
'es5/no-default-parameters': 'error',
'es5/no-destructuring': 'off',
'es5/no-es6-methods': 'off',
'es5/no-es6-static-methods': 'error',
'es5/no-exponentiation-operator': 'error',
'es5/no-for-of': 'error',
'es5/no-generators': 'error',
'es5/no-modules': 'error',
'es5/no-object-super': 'error',
'es5/no-rest-parameters': 'error',
'es5/no-shorthand-properties': 'error',
'es5/no-spread': 'error',
'es5/no-template-literals': 'error',
'es5/no-typeof-symbol': 'error',
'es5/no-unicode-code-point-escape': 'error',
'es5/no-unicode-regex': 'error',
'global-require': 'off',
'import/extensions': 'off',
'import/no-unresolved': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-dynamic-require': 'off',
'new-cap': 'off',
'no-var': 'off',
'no-restricted-globals': 'off',
'object-shorthand': 'off',
'prefer-arrow-callback': 'off',
'prefer-const': 'off',
'prefer-destructuring': 'off',
'prefer-rest-params': 'off',
'prefer-spread': 'off',
'prefer-template': 'off',
'unicorn/no-for-loop': 'off',
'unicorn/prefer-array-flat': 'off',
'unicorn/prefer-array-flat-map': 'off',
'unicorn/prefer-at': 'off',
'unicorn/prefer-default-parameters': 'off',
'unicorn/prefer-modern-math-apis': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prefer-node-protocol': 'off',
'unicorn/prefer-optional-catch-binding': 'off',
'unicorn/prefer-reflect-apply': 'off',
'unicorn/prefer-string-replace-all': 'off',
'unicorn/prefer-spread': 'off',
strict: 'off',
},
overrides: [
{
files: [
'**/controllers/**',
],
rules: {
'sitegenesis/no-global-require': ['error'],
},
},
{
files: [
'**/*.test.js',
'**/__tests__/**',
'**/__mocks__/**',
],
rules: {
'es5/no-binary-and-octal-literals': 'off',
'es5/no-block-scoping': 'off',
'es5/no-classes': 'off',
'es5/no-computed-properties': 'off',
'es5/no-default-parameters': 'off',
'es5/no-destructuring': 'off',
'es5/no-es6-methods': 'off',
'es5/no-es6-static-methods': 'off',
'es5/no-exponentiation-operator': 'off',
'es5/no-for-of': 'off',
'es5/no-generators': 'off',
'es5/no-modules': 'off',
'es5/no-object-super': 'off',
'es5/no-rest-parameters': 'off',
'es5/no-shorthand-properties': 'off',
'es5/no-spread': 'off',
'es5/no-template-literals': 'off',
'es5/no-typeof-symbol': 'off',
'es5/no-unicode-code-point-escape': 'off',
'es5/no-unicode-regex': 'off',
},
},
],
}