UNPKG

@liberu-ui/laravel-validation

Version:
92 lines (89 loc) 4.55 kB
``` /** * Configuration file for ESLint with TypeScript support. * @module eslintConfig */ /** * @typedef {object} EslintConfig * @property {boolean} root - Specifies whether or not this configuration is the root of the project. * @property {Array<string>} extends - The configuration files to extend from. * @property {Array<string>} plugins - The ESLint plugins to use. * @property {object} globals - Global variables available to the codebase. * @property {boolean} globals.axios - Specifies whether or not axios is a global variable. * @property {object} parserOptions - Configuration options for the parser. * @property {string} parserOptions.parser - The parser to be used. * @property {string} parserOptions.sourceType - The source type of the code (module or script). * @property {number} parserOptions.ecmaVersion - The ECMAScript version to be used. * @property {boolean} parserOptions.allowImportExportEverywhere - Specifies whether or not import and export declarations are allowed anywhere in the code. * @property {object} rules - ESLint rules to be applied. * @property {string} rules.no-console - Rule to disallow the use of console.log(). * @property {string} rules.no-debugger - Rule to disallow the use of debugger. * @property {Array} rules.indent - Rule to enforce consistent indentation. * @property {string} rules.arrow-parens - Rule to enforce consistent usage of parenthesis in arrow functions. * @property {string} rules.vue/html-indent - Rule to enforce consistent indentation for Vue template files. * @property {string} rules.vue/attributes-order - Rule to enforce consistent order of attributes in Vue template files. * @property {string} rules.no-plusplus - Rule to disallow the use of the ++ and -- operators. * @property {string} rules.no-param-reassign - Rule to disallow reassigning function parameters. * @property {string} rules.no-mixed-operators - Rules to disallow the use of mixed binary operators. * @property {string} rules.no-underscore-dangle - Rule to disallow the use of dangling underscores in identifiers. * @property {string} rules.func-names - Rule to enforce named function expressions. * @property {string} rules.no-shadow - Rule to disallow variable shadowing. * @property {string} rules.vue/multi-word-component-names - Rule to enforce consistent naming conventions for Vue components. * @property {string} rules.vue/max-attributes-per-line - Rule to enforce a maximum number of attributes per line in Vue templates. * @property {string} rules.vue/first-attribute-linebreak - Rule to enforce consistent linebreaks after the first attribute in Vue templates. * @property {Array} rules.no-return-assign - Rule to disallow assignment in return statement except for parentheses wrapped. * @property {object} rules.vue/html-closing-bracket-newline - Rule to enforce consistent linebreaks before and after closing brackets in Vue templates. * @property {object} rules.vue/html-closing-bracket-spacing - Rule to enforce consistent spacing before and after closing brackets in Vue templates. */ /** * ESLint configuration object for TypeScript. * @type {EslintConfig} */ const eslintConfig: EslintConfig = { root: true, extends: [ 'airbnb-base', 'plugin:vue/vue3-recommended', ], plugins: [ 'vue', ], globals: { axios: true, }, parserOptions: { parser: 'babel-eslint', sourceType: 'module', ecmaVersion: 2017, allowImportExportEverywhere: true, }, rules: { 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', indent: ['error', 4], 'arrow-parens': ['error', 'as-needed'], 'vue/html-indent': 0, 'vue/attributes-order': 0, 'no-plusplus': 0, 'no-param-reassign': 0, 'no-mixed-operators': 0, 'no-underscore-dangle': 0, 'func-names': 0, 'no-shadow': 0, 'vue/multi-word-component-names': 0, 'vue/max-attributes-per-line': 0, 'vue/first-attribute-linebreak': 0, 'no-return-assign': ['error', 'except-parens'], 'vue/html-closing-bracket-newline': ['error', { singleline: 'never', multiline: 'never', }], 'vue/html-closing-bracket-spacing': ['error', { startTag: 'never', endTag: 'never', selfClosingTag: 'never', }], }, }; export default eslintConfig; ```