Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint 8.57.0 to 9.x.x #658

Open
1 of 2 tasks
nsano-rururu opened this issue Jul 29, 2024 · 4 comments
Open
1 of 2 tasks

eslint 8.57.0 to 9.x.x #658

nsano-rururu opened this issue Jul 29, 2024 · 4 comments
Assignees
Labels
Milestone

Comments

@nsano-rururu
Copy link
Collaborator

nsano-rururu commented Jul 29, 2024

  • praeco
  • elastalert-server
(node:62115) ESLintIgnoreWarning: The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
(Use `node --trace-warnings ...` to show where the warning was created)

Oops! Something went wrong! :(

ESLint: 9.8.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.
@nsano-rururu nsano-rururu changed the title [elastalert-server]eslint 8.57.0 to 9.x.x eslint 8.57.0 to 9.x.x Aug 11, 2024
@nsano-rururu nsano-rururu modified the milestones: 1.8.20, 1.8.x Aug 12, 2024
@nsano-rururu nsano-rururu added this to the 2.x.x milestone Aug 20, 2024
@nsano-rururu
Copy link
Collaborator Author

@nsano-rururu nsano-rururu modified the milestones: 2.x.x, 1.8.x, 2.0.0 Dec 31, 2024
@nsano-rururu nsano-rururu modified the milestones: 2.0.0, 1.8.20 Jan 3, 2025
@nsano-rururu nsano-rururu removed the 2.0.0 label Jan 3, 2025
@nsano-rururu
Copy link
Collaborator Author

praeco

import rulesdir from "eslint-plugin-rulesdir";
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
    baseDirectory: __dirname,
    recommendedConfig: js.configs.recommended,
    allConfig: js.configs.all
});

export default [
    ...compat.extends("plugin:vue/vue3-recommended", "@vue/eslint-config-airbnb"),
    {
        plugins: {
            rulesdir,
        },

        languageOptions: {
            globals: {
                ...globals.node,
                ...globals.mocha,
            },

            ecmaVersion: 5,
            sourceType: "commonjs",

            parserOptions: {
                parser: "@babel/eslint-parser",
                requireConfigFile: false,
            },
        },

        rules: {
            "rulesdir/custom1": "off",
            "vue/max-len": "off",
            "import/no-unresolved": "off",
            "vuejs-accessibility/rule-name": "off",
            "vuejs-accessibility/label-has-for": "off",
            "vuejs-accessibility/click-events-have-key-events": "off",
            "vuejs-accessibility/no-autofocus": "off",
            "vuejs-accessibility/anchor-has-content": "off",
            quotes: ["error", "single"],
            "no-underscore-dangle": "off",
            "no-empty": "off",
            radix: "off",
            "no-cond-assign": "off",
            "no-plusplus": "off",
            "default-case": "off",
            "no-labels": "off",
            "no-restricted-syntax": "off",
            "consistent-return": "off",
            "func-names": "off",
            "arrow-parens": "off",
            camelcase: "off",
            "no-console": "off",
            "no-alert": "off",
            "prefer-const": "off",
            "comma-dangle": "off",
            "prefer-destructuring": "off",
            "space-before-function-paren": "off",
            "no-new": "off",
            "max-len": "off",
            "vue/require-v-for-key": "off",
            "vue/require-prop-types": "off",
            "vue/max-attributes-per-line": "off",
            "import/prefer-default-export": "off",
            "vue/multi-word-component-names": "off",
            "import/no-cycle": "off",

            "import/extensions": ["off", "always", {
                js: "never",
                vue: "never",
            }],

            "no-param-reassign": "off",

            "import/no-extraneous-dependencies": ["error", {
                optionalDependencies: ["test/unit/index.js"],
            }],

            "no-debugger": "off",

            "vue/html-closing-bracket-newline": ["error", {
                singleline: "never",
                multiline: "never",
            }],

            "no-restricted-imports": ["error", {
                paths: [{
                    name: "vue",
                    importNames: ["default"],
                }],
            }],
        },
    },
    {
        files: ["**/.eslintrc.js"],

        rules: {
            "quote-props": "off",
        },
    },
    {
        files: ["src/App.vue"],

        rules: {
            "vue/v-on-event-hyphenation": "off",
        },
    },
    {
        files: [
            "src/components/DateTime.vue",
            "src/components/config/ConfigTest.vue",
            "src/views/ConfigBuilder.vue",
        ],

        rules: {
            "vue/no-deprecated-destroyed-lifecycle": "off",
        },
    },
    {
        files: [
            "src/components/ElastalertTimePicker.vue",
            "src/components/NavTree.vue",
            "src/components/config/ConfigCondition.vue",
            "src/components/config/ConfigKibanaDiscover.vue",
            "src/components/config/ConfigQuery.vue",
            "src/components/config/ConfigSettings.vue",
            "src/components/config/alert/ConfigAlert.vue",
            "src/components/config/alert/ConfigAlertAlerta.vue",
            "src/components/config/alert/ConfigAlertCommand.vue",
            "src/components/config/alert/ConfigAlertGoogleChat.vue",
            "src/components/config/alert/ConfigAlertHttpPost.vue",
            "src/components/config/alert/ConfigAlertHttpPost2.vue",
            "src/components/config/alert/ConfigAlertMattermost.vue",
            "src/components/config/alert/ConfigAlertMatrixHookshot.vue",
            "src/components/config/alert/ConfigAlertMsTeams.vue",
            "src/components/config/alert/ConfigAlertMsPowerAutomate.vue",
            "src/components/config/alert/ConfigAlertPagerDuty.vue",
            "src/components/config/alert/ConfigAlertRocketChat.vue",
            "src/components/config/alert/ConfigAlertSlack.vue",
            "src/components/config/alert/ConfigAlertSubjectBody.vue",
            "src/components/config/alert/ConfigAlertTencentSms.vue",
            "src/components/config/alert/ConfigAlertTheHive.vue",
            "src/views/RuleView.vue",
            "src/views/TemplateView.vue",
        ],

        rules: {
            "vue/no-deprecated-v-on-native-modifier": "off",
        },
    },
    {
        files: [
            "src/components/ESChart.vue",
            "src/contrib.js",
            "src/main.js",
            "src/registration.js",
            "src/router.js",
            "src/store/config/match.js",
            "src/store/config/settings.js",
            "src/store/configs.js",
            "src/store/index.js",
            "src/store/metadata.js",
        ],

        rules: {
            "no-restricted-imports": "off",
        },
    },
    {
        files: [
            "src/components/config/ConfigCondition.vue",
            "src/views/RuleView.vue",
            "src/views/TemplateView.vue",
        ],

        rules: {
            "vue/no-deprecated-v-bind-sync": "off",
        },
    },
    {
        files: ["src/views/ConfigBuilder.vue"],

        rules: {
            "vue/v-on-event-hyphenation": "off",
        },
    },
];

package.json

# mod
babel/core 7.26.0
eslint 9.17.0
eslint-plugin-cypress 4.1.0
eslint-plugin-import 2.31.0
eslint-plugin-vue 9.32.0

# add
eslint/compt 1.2.4
eslint/eslintrc 3.2.0
eslint/js 9.17.0
globals 15.14.0

error

$ npm run lint

> praeco@1.8.19 lint
> vue-cli-service lint --no-fix

 ERROR  Error: Invalid Options:
        - Unknown options: extensions, ignorePath, reportUnusedDisableDirectives, resolvePluginsRelativeTo, rulePaths, useEslintrc
        - 'extensions' has been removed.
        - 'resolvePluginsRelativeTo' has been removed.
        - 'ignorePath' has been removed.
        - 'rulePaths' has been removed. Please define your rules using plugins.
        - 'reportUnusedDisableDirectives' has been removed. Please use the 'overrideConfig.linterOptions.reportUnusedDisableDirectives' option instead.
Error: Invalid Options:
- Unknown options: extensions, ignorePath, reportUnusedDisableDirectives, resolvePluginsRelativeTo, rulePaths, useEslintrc
- 'extensions' has been removed.
- 'resolvePluginsRelativeTo' has been removed.
- 'ignorePath' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.
- 'reportUnusedDisableDirectives' has been removed. Please use the 'overrideConfig.linterOptions.reportUnusedDisableDirectives' option instead.
    at processOptions (/home/sano3/dkwork3/praeco/node_modules/eslint/lib/eslint/eslint-helpers.js:843:15)
    at new ESLint (/home/sano3/dkwork3/praeco/node_modules/eslint/lib/eslint/eslint.js:449:34)
    at lint (/home/sano3/dkwork3/praeco/node_modules/@vue/cli-plugin-eslint/lint.js:61:18)
    at /home/sano3/dkwork3/praeco/node_modules/@vue/cli-plugin-eslint/index.js:84:30
    at Service.run (/home/sano3/dkwork3/praeco/node_modules/@vue/cli-service/lib/Service.js:262:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

@nsano-rururu nsano-rururu added the help wanted Extra attention is needed label Jan 3, 2025
@nsano-rururu
Copy link
Collaborator Author

@nsano-rururu nsano-rururu modified the milestone: 2.x.x Jan 3, 2025
@nsano-rururu nsano-rururu added this to the 2.0.0 milestone Jan 3, 2025
@nsano-rururu nsano-rururu added 2.0.0 and removed help wanted Extra attention is needed labels Jan 3, 2025
@nsano-rururu nsano-rururu modified the milestones: 2.0.0, 2.x.x Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant