@gravityforms/gulp-tasks
Version:
Configurable Gulp tasks for use in Gravity Forms projects.
183 lines (181 loc) • 4.58 kB
JavaScript
const path = require( 'path' );
module.exports = {
extends: [ 'eslint:recommended', 'plugin:jsx-a11y/recommended', 'plugin:react/recommended', 'plugin:react-hooks/recommended', 'plugin:jsdoc/recommended' ],
parser: '@babel/eslint-parser',
env: {
browser: true,
amd: true,
node: true,
jest: true,
es6: true,
},
globals: {
shallow: false,
mount: false,
render: false,
jsdom: false,
jquery: true,
$: true,
},
parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
},
rules: {
'array-bracket-spacing': [ 'error', 'always' ],
'array-callback-return': 'error',
'arrow-parens': [ 'error', 'always' ],
'arrow-spacing': 'error',
'computed-property-spacing': [ 'error', 'always' ],
'constructor-super': 'error',
'object-shorthand': 'error',
'prefer-const': [
'error',
{
destructuring: 'all',
},
],
quotes: [
'error',
'single',
{ allowTemplateLiterals: true, avoidEscape: true },
],
'space-unary-ops': [
'error',
{
overrides: {
'!': true,
yield: true,
},
},
],
'template-curly-spacing': [ 'error', 'always' ],
'brace-style': [ 'error', '1tbs' ],
camelcase: [
'error',
{
properties: 'never',
},
],
'comma-dangle': [ 'error', 'always-multiline' ],
'comma-spacing': 'error',
'comma-style': [ 'error', 'last' ],
curly: [ 'error', 'all' ],
'dot-notation': 'error',
'eol-last': 'error',
eqeqeq: 'error',
'func-call-spacing': 'error',
indent: [ 'error', 'tab', { SwitchCase: 1 } ],
'jsdoc/check-line-alignment': [ 'warn', 'always', {
tags: [ 'param', 'property' ],
} ],
'jsdoc/no-undefined-types': 'off',
'jsdoc/require-description': [ 2, {
descriptionStyle: 'tag',
} ],
'jsdoc/tag-lines': [ 'warn', 'any', {
tags: {
example: { lines: 'always' },
since: { lines: 'always' },
},
endLines: 1,
} ],
'key-spacing': 'error',
'keyword-spacing': 'error',
'linebreak-style': [ 'error', 'unix' ],
'no-alert': 'error',
'no-bitwise': 'error',
'no-caller': 'error',
'no-cond-assign': [ 'error', 'except-parens' ],
'no-debugger': 'error',
'no-dupe-args': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-else-return': 'error',
'no-eval': 'error',
'no-extra-semi': 'error',
'no-fallthrough': 'error',
'no-irregular-whitespace': 'error',
'no-lonely-if': 'error',
'no-multi-str': 'error',
'no-mixed-operators': 'error',
'no-mixed-spaces-and-tabs': 'error',
'no-multiple-empty-lines': [ 'error', { max: 1 } ],
'no-multi-spaces': 'error',
'no-negated-in-lhs': 'error',
'no-nested-ternary': 'error',
'no-redeclare': 'error',
'no-shadow': 'error',
'no-trailing-spaces': 'error',
'no-undef': 'error',
'no-undef-init': 'error',
'no-unreachable': 'error',
'no-unsafe-negation': 'error',
'no-unused-expressions': 'error',
'no-unused-vars': 'error',
'no-useless-return': 'error',
'no-whitespace-before-property': 'error',
'no-with': 'error',
'no-const-assign': 'error',
'no-dupe-class-members': 'error',
'no-duplicate-imports': 'error',
'no-useless-computed-key': 'error',
'no-useless-constructor': 'error',
'no-var': 'error',
'object-curly-spacing': [ 'error', 'always' ],
'one-var-declaration-per-line': [ 'error', 'initializations' ],
'operator-linebreak': 'error',
'padded-blocks': [ 'error', 'never' ],
'quote-props': [ 'error', 'as-needed' ],
'react/display-name': 'off',
'react/jsx-curly-spacing': [
'error',
{
when: 'always',
children: true,
},
],
'react/jsx-equals-spacing': 'error',
'react/jsx-indent': [ 'error', 'tab' ],
'react/jsx-indent-props': [ 'error', 'tab' ],
'react/jsx-key': 'error',
'react/jsx-tag-spacing': 'error',
'react/no-children-prop': 'off',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react-hooks/rules-of-hooks': 'error',
semi: 'error',
'semi-spacing': 'error',
'space-before-blocks': [ 'error', 'always' ],
'space-before-function-paren': [
'error',
{
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
},
],
'space-in-parens': [ 'error', 'always' ],
'space-infix-ops': 'error',
'valid-typeof': 'error',
'vars-on-top': 'error',
'wrap-iife': 'error',
},
settings: {
'import/ignore': [ 'node_modules', '\\.(html|json|properties)$' ],
'import/resolver': {
webpack: {
config: path.resolve( __dirname, 'src/webpack/configs/base.js' ),
},
},
jsdoc: {
tagNamePreference: {
returns: 'return',
},
},
react: {
version: 'detect',
},
},
};