diff --git a/public/themes/custom/hdbt_subtheme/.eslintignore b/public/themes/custom/hdbt_subtheme/.eslintignore new file mode 100644 index 00000000..3da69689 --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/.eslintignore @@ -0,0 +1,3 @@ +node_modules/**/* +webpack.config.js +webpack.svgToSprite.js diff --git a/public/themes/custom/hdbt_subtheme/.eslintrc.json b/public/themes/custom/hdbt_subtheme/.eslintrc.json new file mode 100644 index 00000000..b3086593 --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/.eslintrc.json @@ -0,0 +1,76 @@ +{ + "root": true, + "env": { + "browser": true, + "node": true, + "es6": true + }, + "extends": [ + "airbnb-base", + "prettier", + "plugin:import/recommended" + ], + "plugins": [ + "jsdoc" + ], + "parserOptions": { + "ecmaVersion": 2022, + "sourceType": "module" + }, + "globals": { + "Drupal": true, + "drupalSettings": true, + "drupalTranslations": true, + "jQuery": true, + "_": true, + "Cookies": true, + "Backbone": true, + "Modernizr": true, + "Popper": true, + "Shepherd": true, + "Sortable": true, + "once": true, + "CKEDITOR": true, + "tabbable": true + }, + "rules": { + "arrow-spacing": ["warn", { "before": true, "after": true }], + "comma-spacing": ["warn", { "before": false, "after": true }], + "consistent-return": ["off"], + "import/no-extraneous-dependencies": ["error", {"devDependencies": true}], + "lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }], + "max-nested-callbacks": ["warn", 5], + "no-plusplus": [ + "warn", + { + "allowForLoopAfterthoughts": true + } + ], + "no-param-reassign": ["off"], + "no-prototype-builtins": ["off"], + "no-unused-vars": ["warn"], + "no-underscore-dangle": ["off"], + "no-whitespace-before-property": "warn", + "object-curly-spacing": ["error", "always"], + "operator-linebreak": [ + "error", + "after", + { "overrides": { "?": "ignore", ":": "ignore" } } + ], + "prefer-arrow-callback":["off"], + "quotes": ["warn", "single"], + "semi": ["error", "always"], + "space-in-parens": ["warn", "never"], + "space-before-function-paren": ["error", "never"], + "valid-jsdoc": [ + "warn", + { + "prefer": { + "returns": "return", + "property": "prop" + }, + "requireReturn": false + } + ] + } +} diff --git a/public/themes/custom/hdbt_subtheme/.nvmrc b/public/themes/custom/hdbt_subtheme/.nvmrc index 209e3ef4..40994076 100644 --- a/public/themes/custom/hdbt_subtheme/.nvmrc +++ b/public/themes/custom/hdbt_subtheme/.nvmrc @@ -1 +1 @@ -20 +23 diff --git a/public/themes/custom/hdbt_subtheme/package.json b/public/themes/custom/hdbt_subtheme/package.json index f69942b4..0ad47a9b 100644 --- a/public/themes/custom/hdbt_subtheme/package.json +++ b/public/themes/custom/hdbt_subtheme/package.json @@ -10,7 +10,7 @@ "build": "npm run lint -s && webpack --progress --mode=production --config webpack.config.js", "preinstall": "npx update-browserslist-db@latest", "lint:scss": "npx postcss src/scss/**/*.scss --syntax postcss-scss --use css-declaration-sorter --replace --no-map", - "lint:js": "eslint --fix src/js/", + "lint:js": "eslint --fix src/js/ --no-error-on-unmatched-pattern", "lint": "npm run lint:scss && npm run lint:js" }, "dependencies": {