Verified Commit a8b181e7 authored by godotislate's avatar godotislate
Browse files

task: #3440225 Update to ESLint v9 with standard rules

By: nicrodgers
By: neclimdul
By: longwave
By: woldtwerk
By: tom konda
By: smustgrave
By: konfuzed
By: fjgarlin
By: ptmkenny
By: catch
By: godotislate
By: justafish
By: nod_
By: jonathan1055
parent 2c9c31c0
Loading
Loading
Loading
Loading
Loading

core/.eslintignore

deleted100644 → 0
+0 −24
Changes for core/.eslintignore: 0 added lines, 24 removed lines.
Original line number Diff line number Diff line
assets/vendor/**/*
node_modules/**/*
**/js_test_files/**/*
**/build/**/*
modules/locale/tests/js/locale_test.js
misc/jquery.form.js

# Ignore deliberately malformed YAML files.
modules/system/tests/fixtures/HtaccessTest/access_test.yml
modules/system/tests/themes/test_theme_libraries_empty/test_theme_libraries_empty.info.yml
tests/Drupal/Tests/Core/Asset/library_test_files/empty.libraries.yml
tests/Drupal/Tests/Core/Asset/library_test_files/invalid_file.libraries.yml
tests/Drupal/Tests/Composer/Plugin/Scaffold/fixtures/drupal-assets-fixture/assets/default.services.yml
tests/Drupal/Tests/Composer/Plugin/Scaffold/fixtures/drupal-profile/assets/profile.default.services.yml
modules/system/tests/themes/sdc_theme_test/components/bar/bar.component.yml

# Temporary until they are brought up to standards
scripts/**/*
modules/ckeditor5/webpack.config.js
misc/jquery.form.js
themes/default_admin/migration/js/*.js

# Temporary until they are moved into assets/vendor
modules/navigation/assets/vendor/**/*

core/.eslintrc.jquery.json

deleted100644 → 0
+0 −56
Changes for core/.eslintrc.jquery.json: 0 added lines, 56 removed lines.
Original line number Diff line number Diff line
{
  "plugins": [
    "no-jquery"
  ],
  "rules": {
    "no-jquery/no-ajax": 0,
    "no-jquery/no-ajax-events": 2,
    "no-jquery/no-animate": 2,
    "no-jquery/no-attr": 0,
    "no-jquery/no-bind": 2,
    "no-jquery/no-class": 0,
    "no-jquery/no-clone": 2,
    "no-jquery/no-closest": 0,
    "no-jquery/no-css": 2,
    "no-jquery/no-data": 0,
    "no-jquery/no-deferred": 0,
    "no-jquery/no-delegate": 2,
    "no-jquery/no-each": 0,
    "no-jquery/no-extend": 0,
    "no-jquery/no-fade": 0,
    "no-jquery/no-filter": 0,
    "no-jquery/no-find": 0,
    "no-jquery/no-global-eval": 2,
    "no-jquery/no-grep": 2,
    "no-jquery/no-has": 0,
    "no-jquery/no-hide": 0,
    "no-jquery/no-html": 0,
    "no-jquery/no-in-array": 0,
    "no-jquery/no-is-array": 0,
    "no-jquery/no-is-function": 2,
    "no-jquery/no-is": 2,
    "no-jquery/no-load": 2,
    "no-jquery/no-map": 2,
    "no-jquery/no-merge": 2,
    "no-jquery/no-param": 2,
    "no-jquery/no-parent": 0,
    "no-jquery/no-parents": 0,
    "no-jquery/no-parse-html": 2,
    "no-jquery/no-prop": 0,
    "no-jquery/no-proxy": 2,
    "no-jquery/no-ready": 2,
    "no-jquery/no-serialize": 2,
    "no-jquery/no-show": 0,
    "no-jquery/no-size": 2,
    "no-jquery/no-sizzle": 0,
    "no-jquery/no-slide": 0,
    "no-jquery/no-submit": 2,
    "no-jquery/no-text": 2,
    "no-jquery/no-toggle": 0,
    "no-jquery/no-trigger": 0,
    "no-jquery/no-trim": 2,
    "no-jquery/no-val": 2,
    "no-jquery/no-when": 2,
    "no-jquery/no-wrap": 0
  }
}
 No newline at end of file

core/.eslintrc.json

deleted100644 → 0
+0 −73
Changes for core/.eslintrc.json: 0 added lines, 73 removed lines.
Original line number Diff line number Diff line
{
  "extends": [
    "airbnb-base",
    "plugin:prettier/recommended",
    "plugin:yml/recommended"
  ],
  "root": true,
  "env": {
    "browser": true,
    "es6": true,
    "node": true
  },
  "parserOptions": {
    "ecmaVersion": 2020
  },
  "plugins": [
    "jsdoc"
  ],
  "globals": {
    "Drupal": true,
    "drupalSettings": true,
    "drupalTranslations": true,
    "jQuery": true,
    "_": true,
    "Cookies": true,
    "Backbone": true,
    "htmx": true,
    "loadjs": true,
    "Shepherd": true,
    "Sortable": true,
    "once": true,
    "CKEditor5": true,
    "CKEDITOR": true,
    "tabbable": true,
    "transliterate": true,
    "bodyScrollLock" : true,
    "FloatingUIDOM": true
  },
  "rules": {
    "prettier/prettier": "error",
    "consistent-return": ["off"],
    "no-underscore-dangle": ["off"],
    "max-nested-callbacks": ["warn", 3],
    "import/no-mutable-exports": ["warn"],
    "no-plusplus": ["warn", {
      "allowForLoopAfterthoughts": true
    }],
    "no-param-reassign": ["off"],
    "no-prototype-builtins": ["off"],
    "jsdoc/require-returns": ["off"],
    "jsdoc/require-returns-type": ["warn"],
    "jsdoc/require-returns-description": ["warn"],
    "jsdoc/require-returns-check": ["warn"],
    "jsdoc/require-param": ["warn"],
    "jsdoc/require-param-type": ["warn"],
    "jsdoc/require-param-description": ["warn"],
    "jsdoc/check-param-names": ["warn"],
    "jsdoc/valid-types": ["warn"],
    "jsdoc/require-param-name": ["warn"],
    "jsdoc/check-tag-names": ["warn"],
    "no-unused-vars": ["warn"],
    "operator-linebreak": ["error", "after", { "overrides": { "?": "ignore", ":": "ignore" } }],
    "yml/indent": ["error", 2]
  },
  "settings": {
    "jsdoc": {
      "tagNamePreference": {
        "returns": "return",
        "property": "prop"
      }
    }
  }
}

core/.eslintrc.legacy.json

deleted100644 → 0
+0 −107
Changes for core/.eslintrc.legacy.json: 0 added lines, 107 removed lines.
Original line number Diff line number Diff line
{
  "extends": "eslint:recommended",
  "root": true,
  "env": {
    "browser": true
  },
  "globals": {
    "Drupal": true,
    "drupalSettings": true,
    "drupalTranslations": true,
    "domready": true,
    "jQuery": true,
    "_": true,
    "matchMedia": true,
    "Backbone": true
  },
  "plugins": [
    "jsdoc"
  ],
  "rules": {
    "array-bracket-spacing": ["error", "never"],
    "block-scoped-var": "error",
    "brace-style": ["error", "stroustrup", {"allowSingleLine": true}],
    "comma-dangle": ["error", "never"],
    "comma-spacing": "error",
    "comma-style": ["error", "last"],
    "computed-property-spacing": ["error", "never"],
    "curly": ["error", "all"],
    "eol-last": "error",
    "eqeqeq": ["error", "smart"],
    "guard-for-in": "error",
    "indent": ["error", 2, {"SwitchCase": 1}],
    "key-spacing": ["error", {"beforeColon": false, "afterColon": true}],
    "keyword-spacing": ["error", {"before": true, "after": true}],
    "linebreak-style": ["error", "unix"],
    "lines-around-comment": ["error", {"beforeBlockComment": true, "afterBlockComment": false}],
    "new-parens": "error",
    "no-array-constructor": "error",
    "no-caller": "error",
    "no-catch-shadow": "error",
    "no-eval": "error",
    "no-extend-native": "error",
    "no-extra-bind": "error",
    "no-extra-parens": ["error", "functions"],
    "no-implied-eval": "error",
    "no-iterator": "error",
    "no-label-var": "error",
    "no-labels": "error",
    "no-lone-blocks": "error",
    "no-loop-func": "error",
    "no-multi-spaces": "error",
    "no-multi-str": "error",
    "no-native-reassign": "error",
    "no-nested-ternary": "error",
    "no-new-func": "error",
    "no-new-object": "error",
    "no-new-wrappers": "error",
    "no-octal-escape": "error",
    "no-process-exit": "error",
    "no-proto": "error",
    "no-return-assign": "error",
    "no-script-url": "error",
    "no-sequences": "error",
    "no-shadow-restricted-names": "error",
    "no-spaced-func": "error",
    "no-trailing-spaces": "error",
    "no-undef-init": "error",
    "no-undefined": "error",
    "no-unused-expressions": "error",
    "no-unused-vars": ["error", {"vars": "all", "args": "none"}],
    "no-with": "error",
    "object-curly-spacing": ["error", "never"],
    "one-var": ["error", "never"],
    "quote-props": ["error", "consistent-as-needed"],
    "quotes": ["error", "single", "avoid-escape"],
    "semi": ["error", "always"],
    "semi-spacing": ["error", {"before": false, "after": true}],
    "space-before-blocks": ["error", "always"],
    "space-before-function-paren": ["error", {"anonymous": "always", "named": "never"}],
    "space-in-parens": ["error", "never"],
    "space-infix-ops": "error",
    "space-unary-ops": ["error", { "words": true, "nonwords": false }],
    "spaced-comment": ["error", "always"],
    "strict": ["error", "function"],
    "yoda": ["error", "never"],
    "max-nested-callbacks": ["warn", 3],
    "jsdoc/require-returns": ["off"],
    "jsdoc/require-returns-type": ["warn"],
    "jsdoc/require-returns-description": ["warn"],
    "jsdoc/require-returns-check": ["warn"],
    "jsdoc/require-param": ["warn"],
    "jsdoc/require-param-type": ["warn"],
    "jsdoc/require-param-description": ["warn"],
    "jsdoc/check-param-names": ["warn"],
    "jsdoc/valid-types": ["warn"],
    "jsdoc/require-param-name": ["warn"],
    "jsdoc/check-tag-names": ["warn"]
  },
  "settings": {
    "jsdoc": {
      "tagNamePreference": {
        "returns": "return",
        "property": "prop"
      }
    }
  }
}

core/.eslintrc.passing.json

deleted100644 → 0
+0 −18
Changes for core/.eslintrc.passing.json: 0 added lines, 18 removed lines.
Original line number Diff line number Diff line
{
  "extends": [
    "./.eslintrc.json",
    "./.eslintrc.jquery.json"
  ],
  "rules": {
    "no-shadow": "off",
    "no-new": "off",
    "no-continue": "off",
    "new-cap": "off",
    "max-len": "off",
    "default-case": "off",
    "default-param-last": "off",
    "prefer-destructuring": "off",
    "prefer-regex-literals": "off",
    "import/no-import-module-exports": "off"
  }
}
Loading