code:
// @ts-check

/**
 * @typedef {import('prettier').FileInfoOptions} FileInfoOptions
 * @typedef {import('eslint').ESLint.ObjectMetaProperties} ObjectMetaProperties
 * @typedef {import('prettier').Options & { onDiskFilepath: string, parserMeta?: ObjectMetaProperties['meta'], parserPath?: string, usePrettierrc?: boolean }} Options
 */

const { runAsWorker } = require('synckit');

/**
 * @type {typeof import('prettier')}
 */
let prettier;

runAsWorker(
  /**
   * @param {string} source - The source code to format.
   * @param {Options} options - The prettier options.
   * @param {FileInfoOptions} eslintFileInfoOptions - The file info options.
   * @returns {Promise<string | undefined>} The formatted source code.
   */
  async (
    source,
    {
      filepath,
      onDiskFilepath,
      parserMeta,
      parserPath,
      usePrettierrc,
      ...eslintPrettierOptions
    },
    eslintFileInfoOptions,
  ) => {
    if (!prettier) {
      prettier = await import('prettier');
    }

    const prettierRcOptions = usePrettierrc
      ? await prettier.resolveConfig(onDiskFilepath, {
          editorconfig: true,
        })
      : null;

    const { ignored, inferredParser } = await prettier.getFileInfo(
      onDiskFilepath,
      {
        resolveConfig: false,
        withNodeModules: false,
        ignorePath: '.prettierignore',
        plugins: /** @type {string[] | undefined} */ (
          prettierRcOptions ? prettierRcOptions.plugins : undefined
        ),
        ...eslintFileInfoOptions,
      },
    );

    // Skip if file is ignored using a .prettierignore file
    if (ignored) {
      return;
    }

    const initialOptions = { parser: inferredParser ?? 'babel' };

    // ESLint supports processors that let you extract and lint JS
    // fragments within a non-JS language. In the cases where prettier
    // supports the same language as a processor, we want to process
    // the provided source code as javascript (as ESLint provides the
    // rules with fragments of JS) instead of guessing the parser
    // based off the filename. Otherwise, for instance, on a .md file we
    // end up trying to run prettier over a fragment of JS using the
    // markdown parser, which throws an error.
    // Processors may set virtual filenames for these extracted blocks.
    // If they do so then we want to trust the file extension they
    // provide, and no override is needed.
    // If the processor does not set any virtual filename (signified by
    // `filepath` and `onDiskFilepath` being equal) AND we can't
    // infer the parser from the filename, either because no filename
    // was provided or because there is no parser found for the
    // filename, use javascript.
    // This is added to the options first, so that
    // prettierRcOptions and eslintPrettierOptions can still override
    // the parser.
    //
    // `parserBlocklist` should contain the list of prettier parser
    // names for file types where:
    // * Prettier supports parsing the file type
    // * There is an ESLint processor that extracts JavaScript snippets
    //   from the file type.
    if (filepath === onDiskFilepath) {
      // The following list means the plugin process source into js content
      // but with same filename, so we need to change the parser to `babel`
      // by default.
      // Related ESLint plugins are:
      // 1. `eslint-plugin-graphql` (replacement: `@graphql-eslint/eslint-plugin`)
      // 2. `eslint-plugin-html`
      // 3. `eslint-plugin-markdown@1` (replacement: `eslint-plugin-markdown@2+`)
      // 4. `eslint-plugin-svelte3` (replacement: `eslint-plugin-svelte@2+`)
      const parserBlocklist = ['html'];

      let inferParserToBabel = parserBlocklist.includes(initialOptions.parser);

      switch (inferredParser) {
        // it could be processed by `@graphql-eslint/eslint-plugin` or `eslint-plugin-graphql`
        case 'graphql': {
          if (
            // for `eslint-plugin-graphql`, see https://github.com/apollographql/eslint-plugin-graphql/blob/master/src/index.js#L416
            source.startsWith('ESLintPluginGraphQLFile`')
          ) {
            inferParserToBabel = true;
          }
          break;
        }
        case 'markdown': {
          // it could be processed by `eslint-plugin-markdown@1` or correctly parsed by `eslint-mdx`
          if (
            (typeof parserMeta !== 'undefined' &&
              parserMeta.name !== 'eslint-mdx') ||
            (typeof parserPath === 'string' &&
              !/([\\/])eslint-mdx\1/.test(parserPath))
          ) {
            inferParserToBabel = true;
          }
          break;
        }
        // it could be processed by `@ota-meshi/eslint-plugin-svelte`, `eslint-plugin-svelte` or `eslint-plugin-svelte3`
        case 'svelte': {
          // The `source` would be modified by `eslint-plugin-svelte3`
          if (
            typeof parserPath === 'string' &&
            !/([\\/])svelte-eslint-parser\1/.test(parserPath)
          ) {
            // We do not support `eslint-plugin-svelte3`,
            // the users should run `prettier` on `.svelte` files manually
            return;
          }
        }
      }

      if (inferParserToBabel) {
        initialOptions.parser = 'babel';
      }
    } else {
      // Similar to https://github.com/prettier/stylelint-prettier/pull/22
      // In all of the following cases ESLint extracts a part of a file to
      // be formatted and there exists a prettier parser for the whole file.
      // If you're interested in prettier you'll want a fully formatted file so
      // you're about to run prettier over the whole file anyway.
      // Therefore running prettier over just the style section is wasteful, so
      // skip it.
      const parserBlocklist = [
        'babel',
        'babylon',
        'flow',
        'typescript',
        'vue',
        'markdown',
        'html',
        'mdx',
        'angular',
        'svelte',
        'pug',
      ];
      if (parserBlocklist.includes(/** @type {string} */ (inferredParser))) {
        return;
      }
    }

    /**
     * @type {import('prettier').Options}
     */
    const prettierOptions = {
      ...initialOptions,
      ...prettierRcOptions,
      ...eslintPrettierOptions,
      filepath,
    };

    return prettier.format(source, prettierOptions);
  },
);


code:
The MIT License (MIT)

Copyright (c) 2020 Zdravko Ćurić

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

license: mit


code:
# eslint-plugin-require-sort

  - [Introduction](#introduction)
  - [Installation](#installation)
  - [Usage](#usage)
  - [Rule Details](#rule-details)
  - [Options](#options)
  - [Examples](#examples)
    - [Default settings](#default-settings)
    - [`ignoreCase`](#ignorecase)
    - [`ignoreDeclarationSort`](#ignoredeclarationsort)
    - [`ignorePropertySort`](#ignorepropertysort)
    - [`propertySyntaxSortOrder`](#propertysyntaxsortorder)
  - [Credits](#credits)
  - [Contributions](#contributions)
  - [License](#license)

## Introduction
What is `require`? From latest [Node documentation](https://nodejs.org/api/modules.html) require is a `function`. As Node follows CommonJS module system, `require` function is the easiest way to include modules that exist in separate files - more on that [here](https://nodejs.org/en/knowledge/getting-started/what-is-require/).

Difference between CommonJS and ES2015 modules is very nicely explained [in this short talk](https://www.youtube.com/watch?v=8O_H2JgV7EQ).

[From AST point of view](https://astexplorer.net/#/gist/577afe7c245364a40a495051b8289508/9dc2d43629dd548417fb26b4c2aa9ae68578b7d1) `const foo = require('bar')` is a `VariableDeclaration` and `require` is `CallExpression`. And in this eslint plugin is treated as such.
`foo` is in this case an `Identifier`.
In case of destructuring `const { foo, bar } = require('baz')`, `foo` and `bar` are `properties` in `ObjectPattern`.

This is important for nomenclature in the plugin, because it's not straight forward as in [`sort-imports`](https://eslint.org/docs/rules/sort-imports) rule provided by `eslint`.

In this plugin all `Identifiers` are called `properties` to simplify things. The goal is to follow the AST as closely as possible. What `member` is to `sort-imports` rule, `properties` are to this plugin.

Hopefully this all makes sense.

## Installation

Install [ESLint](http://eslint.org):

```
$ npm install eslint --save-dev
```

Install `eslint-plugin-require-sort`:

```
$ npm install eslint-plugin-require-sort --save-dev
```

**Note:** If you installed ESLint globally (using the `-g` flag) then you must
also install `eslint-plugin-require-sort` globally.

## Usage

Add `require-sort` to the plugins and rules section of your `.eslintrc(.js|.json|.yaml)` configuration
file:

```json
{
  "plugins": ["require-sort"],
  "rules": {
    "require-sort/require-sort": "error"
  }
}
```

## Rule Details

This rule checks all declarations and verifies that all are first sorted by the used property syntax and then alphabetically by the first property or alias name.

The `--fix` option on the command line automatically fixes some problems reported by this rule: multiple properties on a single line are automatically sorted (e.g. `const { b, a } =  require('foo')` is corrected to `const { a, b } =  require('foo')`), but multiple lines are not reordered.

Rule ignores `require` functions inside functions, `if` statements, etc. For example,
```js
function foo() {
  const bar = require('baz');
}
```
will be ignored. Only top level variable declarations with `require` are considered.

## Options

This rule accepts an object with its properties as

* `ignoreCase` (default: `false`)
* `ignoreDeclarationOrder` (default: `false`)
* `ignorePropertySort` (default: `false`)
* `propertySyntaxSortOrder` (default: `["note", "multiple", "single"]`); all items must be present in the array, but you can change the order.

Default option settings are:

```json
{
    "require-sort/require-sort": ["error", {
        "ignoreCase": false,
        "ignoreDeclarationSort": false,
        "ignorePropertySort": false,
        "propertySyntaxSortOrder": ["none", "multiple", "single"]
    }]
}
```

## Examples

### Default settings

Examples of **correct** code for this rule when using default options:

```js
/*eslint require-sort: "error"*/
const { alpha, beta } = require('alpha');
const { delta, gamma } = require('delta');
const a = require('baz');
const b = require('qux');

/*eslint require-sort: "error"*/
const a = require('foo');
const b = require('bar');
const c = require('baz');

/*eslint require-sort: "error"*/
const { a, b } = require('baz');
const c = require('qux');

/*eslint require-sort: "error"*/
const { a, b, c } = require('foo)'
```

Examples of **incorrect** code for this rule when using default options:

```js
/*eslint require-sort: "error"*/
const b = require('foo');
const a = require('bar');

/*eslint require-sort: "error"*/
const a = require('foo');
const A = require('bar');

/*eslint require-sort: "error"*/
const { b, c } = require('foo');
const { a, b } = require('bar');

/*eslint require-sort: "error"*/
const a = require('foo');
const { b, c } = require('bar');

/*eslint require-sort: "error"*/
const a = require('foo');

/*eslint require-sort: "error"*/
const { b, a, c } = require('foo');
```

### `ignoreCase`

When `true` the rule ignores the case-sensitivity of the declaration

Examples of **incorrect** code for this rule with the `{ "ignoreCase": true }` option:

```js
/*eslint require-sort: ["error", { "ignoreCase": true }]*/

const b = require('foo');
const a = require('bar');
```

Examples of **correct** code for this rule with the `{ "ignoreCase": true }` option:

```js
/*eslint require-sort: ["error", { "ignoreCase": true }]*/

const a = require('foo');
const B = require('bar');
const c = require('baz');
```

Default is `false`.

### `ignoreDeclarationSort`

Ignores the sorting of variable declarations with `require`.

Examples of **incorrect** code for this rule with the default `{ "ignoreDeclarationSort": false }` option:

```js
/*eslint require-sort: ["error", { "ignoreDeclarationSort": false }]*/
const b = require('foo');
const a = require('bar');
```

Examples of **correct** code for this rule with the `{ "ignoreDeclarationSort": true }` option:

```js
/*eslint require-sort: ["error", { "ignoreDeclarationSort": true }]*/
const a = require('foo');
const b = require('bar');
```

```js
/*eslint require-sort: ["error", { "ignoreDeclarationSort": true }]*/
const b = require('foo');
const a = require('bar');
```

Default is `false`.

### `ignorePropertySort`

Ignores the property sorting within a `multiple` property in declaration.

Examples of **incorrect** code for this rule with the default `{ "ignorePropertySort": false }` option:

```js
/*eslint require-sort: ["error", { "ignorePropertySort": false }]*/
const { b, a, c } = require('foo');
```

Examples of **correct** code for this rule with the `{ "ignorePropertySort": true }` option:

```js
/*eslint require-sort: ["error", { "ignorePropertySort": true }]*/
const { b, a, c } = require('foo');
```

Default is `false`.

### `propertySyntaxSortOrder`

There are three different styles and the default property syntax sort order is:
s.
* `none` - just a require expression
* `multiple` - require multiple properties.
* `single` - require single property.

Both options must be specified in the array, but you can customize their order.

Examples of **correct** code for this rule with the `{ "propertySyntaxSortOrder": ["none", "single", "multiple"] }` option:

```js
/*eslint require-sort: ["error", { "propertySyntaxSortOrder":  ["none", "single", "multiple"]  }]*/
require('bar');
const z = require('zoo');
const { a, b } = require('foo');
```

Default is `["none", "multiple", "single"]`.

## Credits
- This plugin is [inspired by `sort-imports` rule](https://github.com/eslint/eslint/blob/master/lib/rules/sort-imports.js). Credits to authors an maintainers of that rule.
- [@vladimyr](https://github.com/vladimyr) who pointed me to AST explorer.
- [@kronicker](https://github.com/kronicker) who said it that this won't work in some cases :stuck_out_tongue_winking_eye:

## Contributions
- All contributions, suggestions are welcome.

## License

MIT @ Zdravko Ćurić [(zcuric)](https://github.com/zcuric)


code:
'use strict';

function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }

function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }

function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

module.exports = {
  rules: {
    'require-sort': {
      meta: {
        type: 'suggestion',
        docs: {
          description: 'enforce sorted require declarations within modules',
          category: 'ECMAScript 6',
          recommended: false,
          url: 'https://github.com/zcuric/eslint-plugin-require-sort'
        },
        schema: [{
          type: 'object',
          properties: {
            ignoreCase: {
              type: 'boolean',
              default: false
            },
            propertySyntaxSortOrder: {
              type: 'array',
              items: {
                enum: ['none', 'multiple', 'single']
              },
              uniqueItems: true,
              minItems: 3,
              maxItems: 3
            },
            ignoreDeclarationSort: {
              type: 'boolean',
              default: false
            },
            ignorePropertySort: {
              type: 'boolean',
              default: false
            }
          },
          additionalProperties: false
        }],
        fixable: 'code'
      },
      create: function create(context) {
        var configuration = context.options[0] || {};
        var _configuration$ignore = configuration.ignoreCase,
            ignoreCase = _configuration$ignore === void 0 ? false : _configuration$ignore,
            _configuration$ignore2 = configuration.ignoreDeclarationSort,
            ignoreDeclarationSort = _configuration$ignore2 === void 0 ? false : _configuration$ignore2,
            _configuration$ignore3 = configuration.ignorePropertySort,
            ignorePropertySort = _configuration$ignore3 === void 0 ? false : _configuration$ignore3,
            _configuration$proper = configuration.propertySyntaxSortOrder,
            propertySyntaxSortOrder = _configuration$proper === void 0 ? ['none', 'multiple', 'single'] : _configuration$proper;
        var sourceCode = context.getSourceCode();
        var nodes = [];
        var previousNode = null;

        var handleDeclarationSort = function handleDeclarationSort(node) {
          if (previousNode) {
            var currentIndex = getPropertySyntaxIndex(node);
            var previousIndex = getPropertySyntaxIndex(previousNode);
            /*
             * When the current declaration uses a different property syntax,
             * then check if the ordering is correct.
             * Otherwise, make a default string compare (like rule sort-vars to be consistent)
             * of the first used property name.
             */

            if (currentIndex === previousIndex) {
              reportOnAlphabeticalSort(node, previousNode);
            }

            if (currentIndex < previousIndex) {
              reportOnExpectedSyntax(node, currentIndex, previousIndex);
            }
          }

          previousNode = node;
        };

        var handlePropertySort = function handlePropertySort(node) {
          if (isStaticRequire(node)) return;
          if (!node.declarations[0].id.properties) return;
          var properties = node.declarations[0].id.properties;

          var mergeText = function mergeText(sourceText, property, index) {
            var textAfterProperty = '';

            if (index !== properties.length - 1) {
              textAfterProperty = sourceCode.getText().slice(properties[index].range[1], properties[index + 1].range[0]);
            }

            return sourceText + sourceCode.getText(property) + textAfterProperty;
          };

          var firstUnsortedIndex = properties.map(getSortableName).findIndex(function (name, index, array) {
            return array[index - 1] > name;
          });

          var fix = function fix(_ref) {
            var replaceTextRange = _ref.replaceTextRange;
            // If there are comments in the property list, don't rearrange the properties.
            if (hasComments(properties)) return null;
            var range = [properties[0].range[0], properties[properties.length - 1].range[1]];

            var text = _toConsumableArray(properties).sort(sortByName).reduce(mergeText, '');

            return replaceTextRange(range, text);
          };

          if (firstUnsortedIndex === -1) return;
          var value = properties[firstUnsortedIndex].value;
          var propertyName = isAssignmentPattern(value) ? value.left.name : value.name;
          context.report({
            node: properties[firstUnsortedIndex],
            message: "Property '{{propertyName}}' of the require declaration should be sorted alphabetically.",
            data: {
              propertyName: propertyName
            },
            fix: fix
          });
        };

        var isTopLevel = function isTopLevel(_ref2) {
          var parent = _ref2.parent;
          return parent.type === 'Program';
        };

        var isStaticRequire = function isStaticRequire(node) {
          var _node$callee, _node$callee2, _node$arguments;

          if (node.type !== 'CallExpression') return false;
          return ((_node$callee = node.callee) === null || _node$callee === void 0 ? void 0 : _node$callee.type) === 'Identifier' && ((_node$callee2 = node.callee) === null || _node$callee2 === void 0 ? void 0 : _node$callee2.name) === 'require' && ((_node$arguments = node.arguments) === null || _node$arguments === void 0 ? void 0 : _node$arguments.length) === 1;
        };

        var isRequire = function isRequire(node) {
          var _node$declarations$, _node$declarations$$i, _node$declarations$$i2;

          return ((_node$declarations$ = node.declarations[0]) === null || _node$declarations$ === void 0 ? void 0 : (_node$declarations$$i = _node$declarations$.init) === null || _node$declarations$$i === void 0 ? void 0 : (_node$declarations$$i2 = _node$declarations$$i.callee) === null || _node$declarations$$i2 === void 0 ? void 0 : _node$declarations$$i2.name) === 'require';
        };

        var isAssignmentPattern = function isAssignmentPattern(node) {
          return (node === null || node === void 0 ? void 0 : node.type) === 'AssignmentPattern';
        };

        var hasObjectPattern = function hasObjectPattern(node) {
          var _node$declarations$2, _node$declarations$2$;

          return ((_node$declarations$2 = node.declarations[0]) === null || _node$declarations$2 === void 0 ? void 0 : (_node$declarations$2$ = _node$declarations$2.id) === null || _node$declarations$2$ === void 0 ? void 0 : _node$declarations$2$.type) === 'ObjectPattern';
        };

        var hasMultipleProperties = function hasMultipleProperties(node) {
          var _node$declarations$3, _node$declarations$3$;

          return ((_node$declarations$3 = node.declarations[0]) === null || _node$declarations$3 === void 0 ? void 0 : (_node$declarations$3$ = _node$declarations$3.id) === null || _node$declarations$3$ === void 0 ? void 0 : _node$declarations$3$.properties.length) > 1;
        };

        var hasComments = function hasComments(properties) {
          return properties.some(function (property) {
            var commentsBefore = sourceCode.getCommentsBefore(property);
            var commentsAfter = sourceCode.getCommentsAfter(property);
            return commentsBefore.length || commentsAfter.length;
          });
        };

        var getSortableName = function getSortableName(_ref3) {
          var value = _ref3.value;
          var name = isAssignmentPattern(value) ? value.left.name : value.name;
          if (name) return ignoreCase ? name.toLowerCase() : name;
          return null;
        };

        var sortByName = function sortByName(propertyA, propertyB) {
          var aName = getSortableName(propertyA);
          var bName = getSortableName(propertyB);
          return aName > bName ? 1 : -1;
        };

        var getPropertySyntax = function getPropertySyntax(node) {
          if (isStaticRequire(node)) return 'none';

          if (!hasObjectPattern(node) || !hasMultipleProperties(node)) {
            return 'single';
          }

          return 'multiple';
        };

        var getPropertySyntaxIndex = function getPropertySyntaxIndex(node) {
          return propertySyntaxSortOrder.indexOf(getPropertySyntax(node));
        };

        var getDeclarationName = function getDeclarationName(node) {
          if (isStaticRequire(node)) return node.arguments[0].value;
          if (!hasObjectPattern(node)) return node.declarations[0].id.name;
          var value = node.declarations[0].id.properties[0].value;
          return isAssignmentPattern(value) ? value.left.name : value.name;
        };

        var reportOnAlphabeticalSort = function reportOnAlphabeticalSort(node, previousNode) {
          var firstName = getDeclarationName(node);
          var previousName = getDeclarationName(previousNode);

          if (ignoreCase) {
            previousName = previousName && previousName.toLowerCase();
            firstName = firstName && firstName.toLowerCase();
          }

          if (previousName && firstName && firstName < previousName) {
            context.report({
              node: node,
              message: 'Requires should be sorted alphabetically.'
            });
          }
        };

        var reportOnExpectedSyntax = function reportOnExpectedSyntax(node, currentIndex, previousIndex) {
          context.report({
            node: node,
            message: "Expected '{{syntaxA}}' syntax before '{{syntaxB}}' syntax.",
            data: {
              syntaxA: propertySyntaxSortOrder[currentIndex],
              syntaxB: propertySyntaxSortOrder[previousIndex]
            }
          });
        };

        return {
          ExpressionStatement: function ExpressionStatement(node) {
            if (!isTopLevel(node)) return;
            if (!isStaticRequire(node.expression)) return;
            nodes.push(node.expression);
          },
          VariableDeclaration: function VariableDeclaration(node) {
            if (!isTopLevel(node)) return;
            if (!isRequire(node)) return;
            nodes.push(node);
          },
          'Program:exit': function ProgramExit() {
            if (!ignoreDeclarationSort) nodes.forEach(handleDeclarationSort);
            if (!ignorePropertySort) nodes.forEach(handlePropertySort);
          }
        };
      }
    }
  }
};


eslint-plugin-require-sort

access: public

description: ESlint plugin for sorting requires (CommonJS modules) alphabetically

test: jest

lint: eslint .

prebuild: rimraf dist

prepare: npm run build

build: babel index.js -d dist

release: npx np

type: git

author: Zdravko Ćurić <zcuric@gmail.com>

license: MIT

keywords: commonjs eslint eslint-plugin eslint-plugin-sort-imports eslint-plugin-require-sort node require


code:
---
env:
  mocha: true
extends:
  - kentor
  - kentor/es6


code:
language: node_js
node_js:
 - "4"
 - "5"
 - "6"


Launch

type: node

request: launch

cwd: ${workspaceRoot}

NODE_ENV: development

console: internalConsole

Attach

request: attach

address: localhost

localRoot: ${workspaceRoot}


code:
# eslint-plugin-sort-requires-by-path

ESLint rule to enforce sorting of variable declarations in a group of `require("path")` calls based on "path" string.

## Installation

You'll first need to install [ESLint](http://eslint.org):

```
$ npm install eslint --save-dev
```

Next, install `eslint-plugin-sort-requires-by-path`:

```
$ npm install eslint-plugin-sort-requires-by-path --save-dev
```

**Note:** If you installed ESLint globally (using the `-g` flag) then you must
also install `eslint-plugin-sort-requires-by-path` globally.

## Usage

Add `sort-requires-by-path` to the plugins section of your `.eslintrc` configuration
file. You can omit the `eslint-plugin-` prefix:

```json
{
  "plugins": [
    "sort-requires-by-path"
  ]
}
```

Then configure the rules you want to use under the rules section.

```json
{
  "rules": {
    "sort-requires-by-path/sort-requires-by-path": 2
  }
}
```
## License

[MIT](LICENSE.txt)


code:
'use strict';

/**
 * @author Kenneth Chung, Ondřej Altman
 */

exports.rules = {
  'sort-requires-by-path': require('./rules/sort-requires-by-path')
};


code:
'use strict';

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }

module.exports = {
  meta: {
    fixable: 'code'
  },

  create: function create(context) {
    var sourceCode = context.getSourceCode();

    var hasRequire = /require\(/;
    var groups = [];
    var previousNode = void 0;

    var changeOrder = function changeOrder(indices, indicesMap) {
      return function (acc, value, originalIndex) {
        var newIndex = indicesMap[originalIndex];
        acc[newIndex] = value;
        return acc;
      };
    };

    var arrayMultisort = function arrayMultisort(sortFn) {
      return function (refArray) {
        for (var _len = arguments.length, others = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
          others[_key - 1] = arguments[_key];
        }

        var indices = refArray.map(function (value, index) {
          return index;
        }) // create indices
        .sort(function (a, b) {
          return sortFn(refArray[a], refArray[b]);
        }); // sort according to refArray
        var indicesMap = indices.reduce(function (acc, newIndex, i) {
          return acc[newIndex] = i, acc;
        }, {}); // for fast index lookup
        return [refArray.reduce(changeOrder(indices, indicesMap), [])].concat(_toConsumableArray(others.map(function (other) {
          return other.reduce(changeOrder(indices, indicesMap), []);
        })));
      };
    };

    function isSorted(ary) {
      return ary.every(function (value, idx) {
        return idx === 0 || ary[idx - 1].toLowerCase() <= value.toLowerCase();
      });
    }

    function check(group) {
      var texts = group.map(function (decl) {
        return sourceCode.getText(decl);
      });
      var requireArgs = group.map(function (decl) {
        try {
          return decl.declarations[0].init.arguments[0].raw || '';
        } catch (e) {
          return '';
        }
      });
      if (!isSorted(requireArgs)) {
        var _arrayMultisort = arrayMultisort(function (a, b) {
          var aLower = a.toLowerCase();
          var bLower = b.toLowerCase();
          return aLower < bLower ? -1 : aLower > bLower ? 1 : 0;
        })(requireArgs, texts),
            _arrayMultisort2 = _slicedToArray(_arrayMultisort, 2),
            requireArgsSorted = _arrayMultisort2[0],
            textsSorted = _arrayMultisort2[1];

        context.report({
          loc: { start: group[0].loc.start, end: last(group).loc.end },
          message: 'This group of requires is not sorted',
          fix: function fix(fixer) {
            return fixer.replaceTextRange([group[0].start, last(group).end], textsSorted.join('\n'));
          }
        });
      }
    }

    function last(ary) {
      return ary[ary.length - 1];
    }

    function shouldStartNewGroup(node, previousNode) {
      if (!previousNode) return true;
      if (node.parent !== previousNode.parent) return true;

      var lineOfNode = sourceCode.getFirstToken(node).loc.start.line;
      var lineOfPrev = sourceCode.getLastToken(previousNode).loc.start.line;
      return lineOfNode - lineOfPrev !== 1;
    }

    return {
      VariableDeclaration: function VariableDeclaration(node) {
        if (!hasRequire.test(sourceCode.getText(node))) return;

        if (shouldStartNewGroup(node, previousNode)) {
          groups.push([node]);
        } else {
          last(groups).push(node);
        }

        previousNode = node;
      },
      'Program:exit': function ProgramExit(node) {
        groups.forEach(check);
      }
    };
  }
};


code:
/**
 * @author Kenneth Chung, Ondřej Altman
 */

exports.rules = {
  'sort-requires-by-path': require('./rules/sort-requires-by-path'),
};


code:
'use strict';

module.exports = {
  meta: {
    fixable: 'code',
  },

  create(context) {
    const sourceCode = context.getSourceCode();

    const hasRequire = /require\(/;
    const groups = [];
    let previousNode;

		const changeOrder = (indices, indicesMap) => (acc, value, originalIndex) => {
			const newIndex = indicesMap[originalIndex]
			acc[newIndex] = value
			return acc
		}

		const arrayMultisort = (sortFn) => (refArray, ...others) => {
			const indices = refArray
				.map((value, index) => index)  // create indices
				.sort((a, b) => sortFn(refArray[a], refArray[b]))  // sort according to refArray
			const indicesMap = indices.reduce((acc, newIndex, i) => (acc[newIndex] = i, acc), {})  // for fast index lookup
			return [
				refArray.reduce(changeOrder(indices, indicesMap), []),
				...others.map((other) => other.reduce(changeOrder(indices, indicesMap), []))
			]
		}

		function isSorted(ary) {
      return ary.every((value, idx) =>
        idx === 0 || ary[idx - 1].toLowerCase() <= value.toLowerCase()
      );
    }

    function check(group) {
      const texts = group.map(decl => sourceCode.getText(decl));
			var requireArgs = group.map(function (decl) {
				try {
					return decl.declarations[0].init.arguments[0].raw || '';
				} catch(e) {
					return ''
				}
      });
      if (!isSorted(requireArgs)) {
				const [requireArgsSorted, textsSorted] = arrayMultisort((a, b) => {
          const aLower = a.toLowerCase();
          const bLower = b.toLowerCase();
          return aLower < bLower ? -1 : aLower > bLower ? 1 : 0;
				})(requireArgs, texts)
        context.report({
          loc: { start: group[0].loc.start, end: last(group).loc.end },
          message: 'This group of requires is not sorted',
          fix: fixer => fixer.replaceTextRange(
            [group[0].start, last(group).end],
            textsSorted.join('\n')
          ),
        });
      }
    }

    function last(ary) {
      return ary[ary.length - 1];
    }

    function shouldStartNewGroup(node, previousNode) {
      if (!previousNode) return true;
      if (node.parent !== previousNode.parent) return true;

      const lineOfNode = sourceCode.getFirstToken(node).loc.start.line;
      const lineOfPrev = sourceCode.getLastToken(previousNode).loc.start.line;
      return lineOfNode - lineOfPrev !== 1;
    }

    return {
      VariableDeclaration(node) {
        if (!hasRequire.test(sourceCode.getText(node))) return;

        if (shouldStartNewGroup(node, previousNode)) {
          groups.push([node]);
        } else {
          last(groups).push(node);
        }

        previousNode = node;
      },

      'Program:exit'(node) {
        groups.forEach(check);
      },
    };
  },
};


eslint-plugin-sort-requires-by-path

description: ESLint rule to enforce sorting of variable declarations in a group of require('path') calls by 'path' string

build: rimraf dist && babel lib -d dist

lint:watch: esw -w

prepublish: npm test && npm run build

test:watch: jest --watch

keywords: commonjs eslint eslint-plugin eslint-plugin-sort eslintplugin require sort-requires sorting

author: Ondřej Altman <o1.altman@gmail.com>


code:
const rule = require('../../../lib').rules['sort-requires-by-path'];
const { RuleTester } = require('eslint');

const code = (lines) => lines.join('\n');
const ruleTester = new RuleTester();

ruleTester.run('sort-requires', rule, {
  valid: [
    code([
      'var a = require("./a")',
      'var b = require("./b")',
    ]),
    code([
      'var a = require("./a")',
      'var b =',
      '  require("./b")',
      'var c = require("./c")',
    ]),
    code([
      'var a = require("./a")',
      'var A = require("./A")',
    ]),
    code([
      'var A = require("./A")',
      'var a = require("./a")',
    ]),
    code([
      'var a = require("./a")',
      'var c = require("./c")',
      '',
      'var b = require("./b")',
    ]),
    code([
      'var a = require("./a")',
      'var b = require("./b")',
      'var c = require("./c")',
    ]),
    {
      code: code([
        'var a = require("./a")',
        'var A = require("./aa")',
        'var b = require("./b")',
        'var B = require("./bb")',
        'var { a } = require("./xA")',
				'var { b } = require("./xB")',
        'var _ = require("_")',
      ]),
      parserOptions: { ecmaVersion: 6 },
    },
    {
      code: code([
        'const a = require("./a")',
        'const b = require("./b")',
      ]),
      parserOptions: { ecmaVersion: 6 },
    },
    {
      code: code([
        'const b = require("./a")',
        'let a = require("./b")',
      ]),
      parserOptions: { ecmaVersion: 6 },
    },
    code([
      'var b = "hi"',
      'var a = "sup"',
    ]),
    code([
      'var a = require("./a")',
      'var c = require("./c")',
      '',
      'var b = require("./b")',
    ]),
  ],

  invalid: [
    {
      code: code([
        'var b = require("./b")',
        'var a = require("./a")',
      ]),
      output: code([
				'var a = require("./a")',
        'var b = require("./b")',
      ]),
      errors: [{ message: 'This group of requires is not sorted' }],
    },
    {
      code: code([
        'var b =',
        '  require("./b")',
        'var a = require("./a")',
      ]),
      output: code([
        'var a = require("./a")',
        'var b =',
        '  require("./b")',
      ]),
      errors: [{ message: 'This group of requires is not sorted' }],
    },
    {
      code: code([
        'var b =',
        '',
        '  require("./b")',
        'var a = require("./a")',
      ]),
      output: code([
        'var a = require("./a")',
        'var b =',
        '',
        '  require("./b")',
      ]),
      errors: [{ message: 'This group of requires is not sorted' }],
    },
    {
      code: code([
        'var { a } = require("./b")',
        'var { b } = require("./a")',
      ]),
      errors: [{ message: 'This group of requires is not sorted' }],
      parserOptions: { ecmaVersion: 6 },
    },
    {
      code: code([
        'var { c, a } = require("./b")',
        'var { b } = require("./a")',
      ]),
      output: code([
        'var { b } = require("./a")',
        'var { c, a } = require("./b")',
      ]),
      errors: [{ message: 'This group of requires is not sorted' }],
      parserOptions: { ecmaVersion: 6 },
    },
    {
      code: code([
        'var { b } = require("./b")',
        'var a = require("./a")',
      ]),
      errors: [{ message: 'This group of requires is not sorted' }],
      parserOptions: { ecmaVersion: 6 },
    },
    {
      code: code([
        'let a = require("./b")',
        'const B = require("./a")',
      ]),
      output: code([
        'const B = require("./a")',
        'let a = require("./b")',
      ]),
      errors: [{ message: 'This group of requires is not sorted' }],
      parserOptions: { ecmaVersion: 6 },
    },
    {
      code: code([
        'const a = require("./c")',
        'let c = require("./a")',
        'let b = require("./b")',
      ]),
      output: code([
				'let c = require("./a")',
        'let b = require("./b")',
        'const a = require("./c")',
      ]),
      errors: [{ message: 'This group of requires is not sorted' }],
      parserOptions: { ecmaVersion: 6 },
    },
    {
      code: code([
        'var c = require("./c")',
        'var b = require("./a")',
        'var a = require("./b")',
      ]),
      output: code([
				'var b = require("./a")',
        'var a = require("./b")',
        'var c = require("./c")',
      ]),
      errors: [{ message: 'This group of requires is not sorted' }],
    },
    {
      code: code([
        'var b = require("./b")',
        'var a = require("./a")',
        '',
        'var d = require("./d")',
        'var c = require("./c")',
      ]),
      output: code([
        'var a = require("./a")',
        'var b = require("./b")',
				'',
        'var c = require("./c")',
        'var d = require("./d")',
      ]),
      errors: [
        { message: 'This group of requires is not sorted' },
        { message: 'This group of requires is not sorted' },
      ],
    },
  ],
});


code:
# eslint-plugin-vue

[![NPM version](https://img.shields.io/npm/v/eslint-plugin-vue.svg?style=flat)](https://npmjs.org/package/eslint-plugin-vue)
[![NPM downloads](https://img.shields.io/npm/dm/eslint-plugin-vue.svg?style=flat)](https://npmjs.org/package/eslint-plugin-vue)
[![CircleCI](https://img.shields.io/circleci/project/github/vuejs/eslint-plugin-vue/master.svg?style=flat)](https://circleci.com/gh/vuejs/eslint-plugin-vue)
[![License](https://img.shields.io/github/license/vuejs/eslint-plugin-vue.svg?style=flat)](https://github.com/vuejs/eslint-plugin-vue/blob/master/LICENSE)

> Official ESLint plugin for Vue.js

## :book: Documentation

Please refer to the [official website](https://eslint.vuejs.org).

## :anchor: Versioning Policy

This plugin follows [Semantic Versioning](https://semver.org) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy).

## :newspaper: Releases

This project uses [GitHub Releases](https://github.com/vuejs/eslint-plugin-vue/releases).

## :beers: Contribution Guide

Contributing is welcome! See the [ESLint Vue Plugin Developer Guide](https://eslint.vuejs.org/developer-guide).

### Working With Rules

Be sure to read the [official ESLint guide](https://eslint.org/docs/developer-guide/working-with-rules) before you start writing a new rule.

To see what an abstract syntax tree (AST) of your code looks like, you may use [AST Explorer](https://astexplorer.net). After opening [AST Explorer](https://astexplorer.net), select `Vue` as the syntax and `vue-eslint-parser` as the parser.

The default JavaScript parser must be replaced because [Vue.js single file components](https://vuejs.org/guide/scaling-up/sfc.html) are not plain JavaScript, but a custom file format. [`vue-eslint-parser`](https://github.com/vuejs/vue-eslint-parser) is a replacement parser that generates an enhanced AST with nodes that represent specific parts of the template syntax, as well as the contents of the `<script>` tag.

To learn more about certain nodes in a produced AST, see the [ESTree project page](https://github.com/estree/estree) and the [vue-eslint-parser AST documentation](https://github.com/vuejs/vue-eslint-parser/blob/master/docs/ast.md).

`vue-eslint-parser` provides a few useful parser services to help traverse the produced AST and access template tokens:

- `context.parserServices.defineTemplateBodyVisitor(visitor, scriptVisitor)`
- `context.parserServices.getTemplateBodyTokenStore()`

Check out an [example rule](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/mustache-interpolation-spacing.js) to see usage of these services.

Be aware that depending on the code samples you write in tests, the `RuleTester` parser property must be set accordingly (this can be done on a test by test basis). See an [example here](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/attribute-hyphenation.js#L19).

If you're stuck, remember there are many rules available for reference. If you can't find the right solution, don't hesitate to reach out in [issues](https://github.com/vuejs/eslint-plugin-vue/issues) – we're happy to help!

## :lock: License

See the [LICENSE](LICENSE) file for license rights and limitations (MIT).


code:
/*
 * IMPORTANT!
 * This file has been automatically generated,
 * in order to update its content execute "npm run update"
 */
module.exports = {
  parser: require.resolve('vue-eslint-parser'),
  parserOptions: {
    ecmaVersion: 2020,
    sourceType: 'module'
  },
  env: {
    browser: true,
    es6: true
  },
  plugins: ['vue'],
  rules: {
    'vue/comment-directive': 'error',
    'vue/jsx-uses-vars': 'error'
  }
}


code:
/*
 * IMPORTANT!
 * This file has been automatically generated,
 * in order to update its content execute "npm run update"
 */
const globals = require('globals')
module.exports = [
  {
    name: 'vue/base/setup',
    plugins: {
      get vue() {
        return require('../../index')
      }
    },
    languageOptions: {
      sourceType: 'module',
      globals: globals.browser
    }
  },
  {
    name: 'vue/base/setup-for-vue',
    files: ['*.vue', '**/*.vue'],
    plugins: {
      get vue() {
        return require('../../index')
      }
    },
    languageOptions: {
      parser: require('vue-eslint-parser'),
      sourceType: 'module',
      globals: globals.browser
    },
    rules: {
      'vue/comment-directive': 'error',
      'vue/jsx-uses-vars': 'error'
    },
    processor: 'vue/vue'
  }
]


code:
/*
 * IMPORTANT!
 * This file has been automatically generated,
 * in order to update its content execute "npm run update"
 */
'use strict'
const config = require('./base.js')

module.exports = [
  ...config,
  {
    name: 'vue/vue2-essential/rules',
    rules: {
      'vue/multi-word-component-names': 'error',
      'vue/no-arrow-functions-in-watch': 'error',
      'vue/no-async-in-computed-properties': 'error',
      'vue/no-child-content': 'error',
      'vue/no-computed-properties-in-data': 'error',
      'vue/no-custom-modifiers-on-v-model': 'error',
      'vue/no-dupe-keys': 'error',
      'vue/no-dupe-v-else-if': 'error',
      'vue/no-duplicate-attributes': 'error',
      'vue/no-export-in-script-setup': 'error',
      'vue/no-multiple-template-root': 'error',
      'vue/no-mutating-props': 'error',
      'vue/no-parsing-error': 'error',
      'vue/no-ref-as-operand': 'error',
      'vue/no-reserved-component-names': 'error',
      'vue/no-reserved-keys': 'error',
      'vue/no-reserved-props': [
        'error',
        {
          vueVersion: 2
        }
      ],
      'vue/no-shared-component-data': 'error',
      'vue/no-side-effects-in-computed-properties': 'error',
      'vue/no-template-key': 'error',
      'vue/no-textarea-mustache': 'error',
      'vue/no-unused-components': 'error',
      'vue/no-unused-vars': 'error',
      'vue/no-use-computed-property-like-method': 'error',
      'vue/no-use-v-if-with-v-for': 'error',
      'vue/no-useless-template-attributes': 'error',
      'vue/no-v-for-template-key': 'error',
      'vue/no-v-model-argument': 'error',
      'vue/no-v-text-v-html-on-component': 'error',
      'vue/require-component-is': 'error',
      'vue/require-prop-type-constructor': 'error',
      'vue/require-render-return': 'error',
      'vue/require-v-for-key': 'error',
      'vue/require-valid-default-prop': 'error',
      'vue/return-in-computed-property': 'error',
      'vue/return-in-emits-validator': 'error',
      'vue/use-v-on-exact': 'error',
      'vue/valid-attribute-name': 'error',
      'vue/valid-define-emits': 'error',
      'vue/valid-define-props': 'error',
      'vue/valid-model-definition': 'error',
      'vue/valid-next-tick': 'error',
      'vue/valid-template-root': 'error',
      'vue/valid-v-bind-sync': 'error',
      'vue/valid-v-bind': 'error',
      'vue/valid-v-cloak': 'error',
      'vue/valid-v-else-if': 'error',
      'vue/valid-v-else': 'error',
      'vue/valid-v-for': 'error',
      'vue/valid-v-html': 'error',
      'vue/valid-v-if': 'error',
      'vue/valid-v-model': 'error',
      'vue/valid-v-on': 'error',
      'vue/valid-v-once': 'error',
      'vue/valid-v-pre': 'error',
      'vue/valid-v-show': 'error',
      'vue/valid-v-slot': 'error',
      'vue/valid-v-text': 'error'
    }
  }
]


code:
/*
 * IMPORTANT!
 * This file has been automatically generated,
 * in order to update its content execute "npm run update"
 */
'use strict'
const config = require('./vue2-strongly-recommended.js')

module.exports = [
  ...config,
  {
    name: 'vue/vue2-recommended/rules',
    rules: {
      'vue/attributes-order': 'warn',
      'vue/component-tags-order': 'warn',
      'vue/no-lone-template': 'warn',
      'vue/no-multiple-slot-args': 'warn',
      'vue/no-v-html': 'warn',
      'vue/order-in-components': 'warn',
      'vue/this-in-template': 'warn'
    }
  }
]


code:
/*
 * IMPORTANT!
 * This file has been automatically generated,
 * in order to update its content execute "npm run update"
 */
'use strict'
const config = require('./vue2-essential.js')

module.exports = [
  ...config,
  {
    name: 'vue/vue2-strongly-recommended/rules',
    rules: {
      'vue/attribute-hyphenation': 'warn',
      'vue/component-definition-name-casing': 'warn',
      'vue/first-attribute-linebreak': 'warn',
      'vue/html-closing-bracket-newline': 'warn',
      'vue/html-closing-bracket-spacing': 'warn',
      'vue/html-end-tags': 'warn',
      'vue/html-indent': 'warn',
      'vue/html-quotes': 'warn',
      'vue/html-self-closing': 'warn',
      'vue/max-attributes-per-line': 'warn',
      'vue/multiline-html-element-content-newline': 'warn',
      'vue/mustache-interpolation-spacing': 'warn',
      'vue/no-multi-spaces': 'warn',
      'vue/no-spaces-around-equal-signs-in-attribute': 'warn',
      'vue/no-template-shadow': 'warn',
      'vue/one-component-per-file': 'warn',
      'vue/prop-name-casing': 'warn',
      'vue/require-default-prop': 'warn',
      'vue/require-prop-types': 'warn',
      'vue/singleline-html-element-content-newline': 'warn',
      'vue/v-bind-style': 'warn',
      'vue/v-on-style': 'warn',
      'vue/v-slot-style': 'warn'
    }
  }
]


code:
/*
 * IMPORTANT!
 * This file has been automatically generated,
 * in order to update its content execute "npm run update"
 */
'use strict'
const config = require('./base.js')

module.exports = [
  ...config,
  {
    name: 'vue/essential/rules',
    rules: {
      'vue/multi-word-component-names': 'error',
      'vue/no-arrow-functions-in-watch': 'error',
      'vue/no-async-in-computed-properties': 'error',
      'vue/no-child-content': 'error',
      'vue/no-computed-properties-in-data': 'error',
      'vue/no-deprecated-data-object-declaration': 'error',
      'vue/no-deprecated-destroyed-lifecycle': 'error',
      'vue/no-deprecated-dollar-listeners-api': 'error',
      'vue/no-deprecated-dollar-scopedslots-api': 'error',
      'vue/no-deprecated-events-api': 'error',
      'vue/no-deprecated-filter': 'error',
      'vue/no-deprecated-functional-template': 'error',
      'vue/no-deprecated-html-element-is': 'error',
      'vue/no-deprecated-inline-template': 'error',
      'vue/no-deprecated-props-default-this': 'error',
      'vue/no-deprecated-router-link-tag-prop': 'error',
      'vue/no-deprecated-scope-attribute': 'error',
      'vue/no-deprecated-slot-attribute': 'error',
      'vue/no-deprecated-slot-scope-attribute': 'error',
      'vue/no-deprecated-v-bind-sync': 'error',
      'vue/no-deprecated-v-is': 'error',
      'vue/no-deprecated-v-on-native-modifier': 'error',
      'vue/no-deprecated-v-on-number-modifiers': 'error',
      'vue/no-deprecated-vue-config-keycodes': 'error',
      'vue/no-dupe-keys': 'error',
      'vue/no-dupe-v-else-if': 'error',
      'vue/no-duplicate-attributes': 'error',
      'vue/no-export-in-script-setup': 'error',
      'vue/no-expose-after-await': 'error',
      'vue/no-lifecycle-after-await': 'error',
      'vue/no-mutating-props': 'error',
      'vue/no-parsing-error': 'error',
      'vue/no-ref-as-operand': 'error',
      'vue/no-reserved-component-names': 'error',
      'vue/no-reserved-keys': 'error',
      'vue/no-reserved-props': 'error',
      'vue/no-shared-component-data': 'error',
      'vue/no-side-effects-in-computed-properties': 'error',
      'vue/no-template-key': 'error',
      'vue/no-textarea-mustache': 'error',
      'vue/no-unused-components': 'error',
      'vue/no-unused-vars': 'error',
      'vue/no-use-computed-property-like-method': 'error',
      'vue/no-use-v-if-with-v-for': 'error',
      'vue/no-useless-template-attributes': 'error',
      'vue/no-v-for-template-key-on-child': 'error',
      'vue/no-v-text-v-html-on-component': 'error',
      'vue/no-watch-after-await': 'error',
      'vue/prefer-import-from-vue': 'error',
      'vue/require-component-is': 'error',
      'vue/require-prop-type-constructor': 'error',
      'vue/require-render-return': 'error',
      'vue/require-slots-as-functions': 'error',
      'vue/require-toggle-inside-transition': 'error',
      'vue/require-v-for-key': 'error',
      'vue/require-valid-default-prop': 'error',
      'vue/return-in-computed-property': 'error',
      'vue/return-in-emits-validator': 'error',
      'vue/use-v-on-exact': 'error',
      'vue/valid-attribute-name': 'error',
      'vue/valid-define-emits': 'error',
      'vue/valid-define-props': 'error',
      'vue/valid-next-tick': 'error',
      'vue/valid-template-root': 'error',
      'vue/valid-v-bind': 'error',
      'vue/valid-v-cloak': 'error',
      'vue/valid-v-else-if': 'error',
      'vue/valid-v-else': 'error',
      'vue/valid-v-for': 'error',
      'vue/valid-v-html': 'error',
      'vue/valid-v-if': 'error',
      'vue/valid-v-is': 'error',
      'vue/valid-v-memo': 'error',
      'vue/valid-v-model': 'error',
      'vue/valid-v-on': 'error',
      'vue/valid-v-once': 'error',
      'vue/valid-v-pre': 'error',
      'vue/valid-v-show': 'error',
      'vue/valid-v-slot': 'error',
      'vue/valid-v-text': 'error'
    }
  }
]


code:
/*
 * IMPORTANT!
 * This file has been automatically generated,
 * in order to update its content execute "npm run update"
 */
'use strict'
const config = require('./vue3-strongly-recommended.js')

module.exports = [
  ...config,
  {
    name: 'vue/recommended/rules',
    rules: {
      'vue/attributes-order': 'warn',
      'vue/component-tags-order': 'warn',
      'vue/no-lone-template': 'warn',
      'vue/no-multiple-slot-args': 'warn',
      'vue/no-v-html': 'warn',
      'vue/order-in-components': 'warn',
      'vue/this-in-template': 'warn'
    }
  }
]


code:
/*
 * IMPORTANT!
 * This file has been automatically generated,
 * in order to update its content execute "npm run update"
 */
'use strict'
const config = require('./vue3-essential.js')

module.exports = [
  ...config,
  {
    name: 'vue/strongly-recommended/rules',
    rules: {
      'vue/attribute-hyphenation': 'warn',
      'vue/component-definition-name-casing': 'warn',
      'vue/first-attribute-linebreak': 'warn',
      'vue/html-closing-bracket-newline': 'warn',
      'vue/html-closing-bracket-spacing': 'warn',
      'vue/html-end-tags': 'warn',
      'vue/html-indent': 'warn',
      'vue/html-quotes': 'warn',
      'vue/html-self-closing': 'warn',
      'vue/max-attributes-per-line': 'warn',
      'vue/multiline-html-element-content-newline': 'warn',
      'vue/mustache-interpolation-spacing': 'warn',
      'vue/no-multi-spaces': 'warn',
      'vue/no-spaces-around-equal-signs-in-attribute': 'warn',
      'vue/no-template-shadow': 'warn',
      'vue/one-component-per-file': 'warn',
      'vue/prop-name-casing': 'warn',
      'vue/require-default-prop': 'warn',
      'vue/require-explicit-emits': 'warn',
      'vue/require-prop-types': 'warn',
      'vue/singleline-html-element-content-newline': 'warn',
      'vue/v-bind-style': 'warn',
      'vue/v-on-event-hyphenation': [
        'warn',
        'always',
        {
          autofix: true
        }
      ],
      'vue/v-on-style': 'warn',
      'vue/v-slot-style': 'warn'
    }
  }
]


code:
/*
 * IMPORTANT!
 * This file has been automatically generated,
 * in order to update its content execute "npm run update"
 */
module.exports = {
  rules: {
    'vue/array-bracket-newline': 'off',
    'vue/array-bracket-spacing': 'off',
    'vue/array-element-newline': 'off',
    'vue/arrow-spacing': 'off',
    'vue/block-spacing': 'off',
    'vue/block-tag-newline': 'off',
    'vue/brace-style': 'off',
    'vue/comma-dangle': 'off',
    'vue/comma-spacing': 'off',
    'vue/comma-style': 'off',
    'vue/define-macros-order': 'off',
    'vue/dot-location': 'off',
    'vue/first-attribute-linebreak': 'off',
    'vue/func-call-spacing': 'off',
    'vue/html-closing-bracket-newline': 'off',
    'vue/html-closing-bracket-spacing': 'off',
    'vue/html-comment-content-newline': 'off',
    'vue/html-comment-content-spacing': 'off',
    'vue/html-comment-indent': 'off',
    'vue/html-indent': 'off',
    'vue/html-quotes': 'off',
    'vue/html-self-closing': 'off',
    'vue/key-spacing': 'off',
    'vue/keyword-spacing': 'off',
    'vue/max-attributes-per-line': 'off',
    'vue/max-len': 'off',
    'vue/multiline-html-element-content-newline': 'off',
    'vue/multiline-ternary': 'off',
    'vue/mustache-interpolation-spacing': 'off',
    'vue/new-line-between-multi-line-property': 'off',
    'vue/no-extra-parens': 'off',
    'vue/no-multi-spaces': 'off',
    'vue/no-spaces-around-equal-signs-in-attribute': 'off',
    'vue/object-curly-newline': 'off',
    'vue/object-curly-spacing': 'off',
    'vue/object-property-newline': 'off',
    'vue/operator-linebreak': 'off',
    'vue/padding-line-between-blocks': 'off',
    'vue/padding-line-between-tags': 'off',
    'vue/padding-lines-in-component-definition': 'off',
    'vue/quote-props': 'off',
    'vue/script-indent': 'off',
    'vue/singleline-html-element-content-newline': 'off',
    'vue/space-in-parens': 'off',
    'vue/space-infix-ops': 'off',
    'vue/space-unary-ops': 'off',
    'vue/template-curly-spacing': 'off',
    'vue/v-for-delimiter-style': 'off'
  }
}


code:
/*
 * IMPORTANT!
 * This file has been automatically generated,
 * in order to update its content execute "npm run update"
 */
module.exports = {
  extends: require.resolve('./base'),
  rules: {
    'vue/multi-word-component-names': 'error',
    'vue/no-arrow-functions-in-watch': 'error',
    'vue/no-async-in-computed-properties': 'error',
    'vue/no-child-content': 'error',
    'vue/no-computed-properties-in-data': 'error',
    'vue/no-custom-modifiers-on-v-model': 'error',
    'vue/no-dupe-keys': 'error',
    'vue/no-dupe-v-else-if': 'error',
    'vue/no-duplicate-attributes': 'error',
    'vue/no-export-in-script-setup': 'error',
    'vue/no-multiple-template-root': 'error',
    'vue/no-mutating-props': 'error',
    'vue/no-parsing-error': 'error',
    'vue/no-ref-as-operand': 'error',
    'vue/no-reserved-component-names': 'error',
    'vue/no-reserved-keys': 'error',
    'vue/no-reserved-props': [
      'error',
      {
        vueVersion: 2
      }
    ],
    'vue/no-shared-component-data': 'error',
    'vue/no-side-effects-in-computed-properties': 'error',
    'vue/no-template-key': 'error',
    'vue/no-textarea-mustache': 'error',
    'vue/no-unused-components': 'error',
    'vue/no-unused-vars': 'error',
    'vue/no-use-computed-property-like-method': 'error',
    'vue/no-use-v-if-with-v-for': 'error',
    'vue/no-useless-template-attributes': 'error',
    'vue/no-v-for-template-key': 'error',
    'vue/no-v-model-argument': 'error',
    'vue/no-v-text-v-html-on-component': 'error',
    'vue/require-component-is': 'error',
    'vue/require-prop-type-constructor': 'error',
    'vue/require-render-return': 'error',
    'vue/require-v-for-key': 'error',
    'vue/require-valid-default-prop': 'error',
    'vue/return-in-computed-property': 'error',
    'vue/return-in-emits-validator': 'error',
    'vue/use-v-on-exact': 'error',
    'vue/valid-attribute-name': 'error',
    'vue/valid-define-emits': 'error',
    'vue/valid-define-props': 'error',
    'vue/valid-model-definition': 'error',
    'vue/valid-next-tick': 'error',
    'vue/valid-template-root': 'error',
    'vue/valid-v-bind-sync': 'error',
    'vue/valid-v-bind': 'error',
    'vue/valid-v-cloak': 'error',
    'vue/valid-v-else-if': 'error',
    'vue/valid-v-else': 'error',
    'vue/valid-v-for': 'error',
    'vue/valid-v-html': 'error',
    'vue/valid-v-if': 'error',
    'vue/valid-v-model': 'error',
    'vue/valid-v-on': 'error',
    'vue/valid-v-once': 'error',
    'vue/valid-v-pre': 'error',
    'vue/valid-v-show': 'error',
    'vue/valid-v-slot': 'error',
    'vue/valid-v-text': 'error'
  }
}


code:
/*
 * IMPORTANT!
 * This file has been automatically generated,
 * in order to update its content execute "npm run update"
 */
module.exports = {
  extends: require.resolve('./vue2-strongly-recommended'),
  rules: {
    'vue/attributes-order': 'warn',
    'vue/component-tags-order': 'warn',
    'vue/no-lone-template': 'warn',
    'vue/no-multiple-slot-args': 'warn',
    'vue/no-v-html': 'warn',
    'vue/order-in-components': 'warn',
    'vue/this-in-template': 'warn'
  }
}


code:
/*
 * IMPORTANT!
 * This file has been automatically generated,
 * in order to update its content execute "npm run update"
 */
module.exports = {
  extends: require.resolve('./vue2-essential'),
  rules: {
    'vue/attribute-hyphenation': 'warn',
    'vue/component-definition-name-casing': 'warn',
    'vue/first-attribute-linebreak': 'warn',
    'vue/html-closing-bracket-newline': 'warn',
    'vue/html-closing-bracket-spacing': 'warn',
    'vue/html-end-tags': 'warn',
    'vue/html-indent': 'warn',
    'vue/html-quotes': 'warn',
    'vue/html-self-closing': 'warn',
    'vue/max-attributes-per-line': 'warn',
    'vue/multiline-html-element-content-newline': 'warn',
    'vue/mustache-interpolation-spacing': 'warn',
    'vue/no-multi-spaces': 'warn',
    'vue/no-spaces-around-equal-signs-in-attribute': 'warn',
    'vue/no-template-shadow': 'warn',
    'vue/one-component-per-file': 'warn',
    'vue/prop-name-casing': 'warn',
    'vue/require-default-prop': 'warn',
    'vue/require-prop-types': 'warn',
    'vue/singleline-html-element-content-newline': 'warn',
    'vue/v-bind-style': 'warn',
    'vue/v-on-style': 'warn',
    'vue/v-slot-style': 'warn'
  }
}


code:
/*
 * IMPORTANT!
 * This file has been automatically generated,
 * in order to update its content execute "npm run update"
 */
module.exports = {
  extends: require.resolve('./base'),
  rules: {
    'vue/multi-word-component-names': 'error',
    'vue/no-arrow-functions-in-watch': 'error',
    'vue/no-async-in-computed-properties': 'error',
    'vue/no-child-content': 'error',
    'vue/no-computed-properties-in-data': 'error',
    'vue/no-deprecated-data-object-declaration': 'error',
    'vue/no-deprecated-destroyed-lifecycle': 'error',
    'vue/no-deprecated-dollar-listeners-api': 'error',
    'vue/no-deprecated-dollar-scopedslots-api': 'error',
    'vue/no-deprecated-events-api': 'error',
    'vue/no-deprecated-filter': 'error',
    'vue/no-deprecated-functional-template': 'error',
    'vue/no-deprecated-html-element-is': 'error',
    'vue/no-deprecated-inline-template': 'error',
    'vue/no-deprecated-props-default-this': 'error',
    'vue/no-deprecated-router-link-tag-prop': 'error',
    'vue/no-deprecated-scope-attribute': 'error',
    'vue/no-deprecated-slot-attribute': 'error',
    'vue/no-deprecated-slot-scope-attribute': 'error',
    'vue/no-deprecated-v-bind-sync': 'error',
    'vue/no-deprecated-v-is': 'error',
    'vue/no-deprecated-v-on-native-modifier': 'error',
    'vue/no-deprecated-v-on-number-modifiers': 'error',
    'vue/no-deprecated-vue-config-keycodes': 'error',
    'vue/no-dupe-keys': 'error',
    'vue/no-dupe-v-else-if': 'error',
    'vue/no-duplicate-attributes': 'error',
    'vue/no-export-in-script-setup': 'error',
    'vue/no-expose-after-await': 'error',
    'vue/no-lifecycle-after-await': 'error',
    'vue/no-mutating-props': 'error',
    'vue/no-parsing-error': 'error',
    'vue/no-ref-as-operand': 'error',
    'vue/no-reserved-component-names': 'error',
    'vue/no-reserved-keys': 'error',
    'vue/no-reserved-props': 'error',
    'vue/no-shared-component-data': 'error',
    'vue/no-side-effects-in-computed-properties': 'error',
    'vue/no-template-key': 'error',
    'vue/no-textarea-mustache': 'error',
    'vue/no-unused-components': 'error',
    'vue/no-unused-vars': 'error',
    'vue/no-use-computed-property-like-method': 'error',
    'vue/no-use-v-if-with-v-for': 'error',
    'vue/no-useless-template-attributes': 'error',
    'vue/no-v-for-template-key-on-child': 'error',
    'vue/no-v-text-v-html-on-component': 'error',
    'vue/no-watch-after-await': 'error',
    'vue/prefer-import-from-vue': 'error',
    'vue/require-component-is': 'error',
    'vue/require-prop-type-constructor': 'error',
    'vue/require-render-return': 'error',
    'vue/require-slots-as-functions': 'error',
    'vue/require-toggle-inside-transition': 'error',
    'vue/require-v-for-key': 'error',
    'vue/require-valid-default-prop': 'error',
    'vue/return-in-computed-property': 'error',
    'vue/return-in-emits-validator': 'error',
    'vue/use-v-on-exact': 'error',
    'vue/valid-attribute-name': 'error',
    'vue/valid-define-emits': 'error',
    'vue/valid-define-props': 'error',
    'vue/valid-next-tick': 'error',
    'vue/valid-template-root': 'error',
    'vue/valid-v-bind': 'error',
    'vue/valid-v-cloak': 'error',
    'vue/valid-v-else-if': 'error',
    'vue/valid-v-else': 'error',
    'vue/valid-v-for': 'error',
    'vue/valid-v-html': 'error',
    'vue/valid-v-if': 'error',
    'vue/valid-v-is': 'error',
    'vue/valid-v-memo': 'error',
    'vue/valid-v-model': 'error',
    'vue/valid-v-on': 'error',
    'vue/valid-v-once': 'error',
    'vue/valid-v-pre': 'error',
    'vue/valid-v-show': 'error',
    'vue/valid-v-slot': 'error',
    'vue/valid-v-text': 'error'
  }
}


code:
/*
 * IMPORTANT!
 * This file has been automatically generated,
 * in order to update its content execute "npm run update"
 */
module.exports = {
  extends: require.resolve('./vue3-strongly-recommended'),
  rules: {
    'vue/attributes-order': 'warn',
    'vue/component-tags-order': 'warn',
    'vue/no-lone-template': 'warn',
    'vue/no-multiple-slot-args': 'warn',
    'vue/no-v-html': 'warn',
    'vue/order-in-components': 'warn',
    'vue/this-in-template': 'warn'
  }
}


code:
/*
 * IMPORTANT!
 * This file has been automatically generated,
 * in order to update its content execute "npm run update"
 */
module.exports = {
  extends: require.resolve('./vue3-essential'),
  rules: {
    'vue/attribute-hyphenation': 'warn',
    'vue/component-definition-name-casing': 'warn',
    'vue/first-attribute-linebreak': 'warn',
    'vue/html-closing-bracket-newline': 'warn',
    'vue/html-closing-bracket-spacing': 'warn',
    'vue/html-end-tags': 'warn',
    'vue/html-indent': 'warn',
    'vue/html-quotes': 'warn',
    'vue/html-self-closing': 'warn',
    'vue/max-attributes-per-line': 'warn',
    'vue/multiline-html-element-content-newline': 'warn',
    'vue/mustache-interpolation-spacing': 'warn',
    'vue/no-multi-spaces': 'warn',
    'vue/no-spaces-around-equal-signs-in-attribute': 'warn',
    'vue/no-template-shadow': 'warn',
    'vue/one-component-per-file': 'warn',
    'vue/prop-name-casing': 'warn',
    'vue/require-default-prop': 'warn',
    'vue/require-explicit-emits': 'warn',
    'vue/require-prop-types': 'warn',
    'vue/singleline-html-element-content-newline': 'warn',
    'vue/v-bind-style': 'warn',
    'vue/v-on-event-hyphenation': [
      'warn',
      'always',
      {
        autofix: true
      }
    ],
    'vue/v-on-style': 'warn',
    'vue/v-slot-style': 'warn'
  }
}


code:
import type { Linter } from 'eslint'

declare const vue: {
  meta: any
  configs: {
    base: Linter.LegacyConfig
    essential: Linter.LegacyConfig
    'no-layout-rules': Linter.LegacyConfig
    recommended: Linter.LegacyConfig
    'strongly-recommended': Linter.LegacyConfig
    'vue3-essential': Linter.LegacyConfig
    'vue3-recommended': Linter.LegacyConfig
    'vue3-strongly-recommended': Linter.LegacyConfig
    'flat/base': Linter.FlatConfig[]
    'flat/vue2-essential': Linter.FlatConfig[]
    'flat/vue2-recommended': Linter.FlatConfig[]
    'flat/vue2-strongly-recommended': Linter.FlatConfig[]
    'flat/essential': Linter.FlatConfig[]
    'flat/recommended': Linter.FlatConfig[]
    'flat/strongly-recommended': Linter.FlatConfig[]
  }
  rules: Record<string, any>
  processors: {
    '.vue': any
    vue: any
  }
  environments: {
    /**
     * @deprecated
     */
    'setup-compiler-macros': {
      globals: {
        defineProps: 'readonly'
        defineEmits: 'readonly'
        defineExpose: 'readonly'
        withDefaults: 'readonly'
      }
    }
  }
}

export = vue


code:
/*
 * IMPORTANT!
 * This file has been automatically generated,
 * in order to update its content execute "npm run update"
 */
'use strict'

const plugin = {
  meta: require('./meta'),
  configs: {
    // eslintrc configs
    base: require('./configs/base'),
    essential: require('./configs/vue2-essential'),
    'no-layout-rules': require('./configs/no-layout-rules'),
    recommended: require('./configs/vue2-recommended'),
    'strongly-recommended': require('./configs/vue2-strongly-recommended'),
    'vue3-essential': require('./configs/vue3-essential'),
    'vue3-recommended': require('./configs/vue3-recommended'),
    'vue3-strongly-recommended': require('./configs/vue3-strongly-recommended'),

    // flat configs
    'flat/base': require('./configs/flat/base.js'),
    'flat/vue2-essential': require('./configs/flat/vue2-essential.js'),
    'flat/vue2-recommended': require('./configs/flat/vue2-recommended.js'),
    'flat/vue2-strongly-recommended': require('./configs/flat/vue2-strongly-recommended.js'),

    // in flat configs, non-prefixed config is for Vue 3 (unlike eslintrc configs)
    'flat/essential': require('./configs/flat/vue3-essential.js'),
    'flat/recommended': require('./configs/flat/vue3-recommended.js'),
    'flat/strongly-recommended': require('./configs/flat/vue3-strongly-recommended.js')
  },
  rules: {
    'array-bracket-newline': require('./rules/array-bracket-newline'),
    'array-bracket-spacing': require('./rules/array-bracket-spacing'),
    'array-element-newline': require('./rules/array-element-newline'),
    'arrow-spacing': require('./rules/arrow-spacing'),
    'attribute-hyphenation': require('./rules/attribute-hyphenation'),
    'attributes-order': require('./rules/attributes-order'),
    'block-lang': require('./rules/block-lang'),
    'block-order': require('./rules/block-order'),
    'block-spacing': require('./rules/block-spacing'),
    'block-tag-newline': require('./rules/block-tag-newline'),
    'brace-style': require('./rules/brace-style'),
    camelcase: require('./rules/camelcase'),
    'comma-dangle': require('./rules/comma-dangle'),
    'comma-spacing': require('./rules/comma-spacing'),
    'comma-style': require('./rules/comma-style'),
    'comment-directive': require('./rules/comment-directive'),
    'component-api-style': require('./rules/component-api-style'),
    'component-definition-name-casing': require('./rules/component-definition-name-casing'),
    'component-name-in-template-casing': require('./rules/component-name-in-template-casing'),
    'component-options-name-casing': require('./rules/component-options-name-casing'),
    'component-tags-order': require('./rules/component-tags-order'),
    'custom-event-name-casing': require('./rules/custom-event-name-casing'),
    'define-emits-declaration': require('./rules/define-emits-declaration'),
    'define-macros-order': require('./rules/define-macros-order'),
    'define-props-declaration': require('./rules/define-props-declaration'),
    'dot-location': require('./rules/dot-location'),
    'dot-notation': require('./rules/dot-notation'),
    'enforce-style-attribute': require('./rules/enforce-style-attribute'),
    eqeqeq: require('./rules/eqeqeq'),
    'first-attribute-linebreak': require('./rules/first-attribute-linebreak'),
    'func-call-spacing': require('./rules/func-call-spacing'),
    'html-button-has-type': require('./rules/html-button-has-type'),
    'html-closing-bracket-newline': require('./rules/html-closing-bracket-newline'),
    'html-closing-bracket-spacing': require('./rules/html-closing-bracket-spacing'),
    'html-comment-content-newline': require('./rules/html-comment-content-newline'),
    'html-comment-content-spacing': require('./rules/html-comment-content-spacing'),
    'html-comment-indent': require('./rules/html-comment-indent'),
    'html-end-tags': require('./rules/html-end-tags'),
    'html-indent': require('./rules/html-indent'),
    'html-quotes': require('./rules/html-quotes'),
    'html-self-closing': require('./rules/html-self-closing'),
    'jsx-uses-vars': require('./rules/jsx-uses-vars'),
    'key-spacing': require('./rules/key-spacing'),
    'keyword-spacing': require('./rules/keyword-spacing'),
    'match-component-file-name': require('./rules/match-component-file-name'),
    'match-component-import-name': require('./rules/match-component-import-name'),
    'max-attributes-per-line': require('./rules/max-attributes-per-line'),
    'max-len': require('./rules/max-len'),
    'max-lines-per-block': require('./rules/max-lines-per-block'),
    'max-props': require('./rules/max-props'),
    'max-template-depth': require('./rules/max-template-depth'),
    'multi-word-component-names': require('./rules/multi-word-component-names'),
    'multiline-html-element-content-newline': require('./rules/multiline-html-element-content-newline'),
    'multiline-ternary': require('./rules/multiline-ternary'),
    'mustache-interpolation-spacing': require('./rules/mustache-interpolation-spacing'),
    'new-line-between-multi-line-property': require('./rules/new-line-between-multi-line-property'),
    'next-tick-style': require('./rules/next-tick-style'),
    'no-arrow-functions-in-watch': require('./rules/no-arrow-functions-in-watch'),
    'no-async-in-computed-properties': require('./rules/no-async-in-computed-properties'),
    'no-bare-strings-in-template': require('./rules/no-bare-strings-in-template'),
    'no-boolean-default': require('./rules/no-boolean-default'),
    'no-child-content': require('./rules/no-child-content'),
    'no-computed-properties-in-data': require('./rules/no-computed-properties-in-data'),
    'no-console': require('./rules/no-console'),
    'no-constant-condition': require('./rules/no-constant-condition'),
    'no-custom-modifiers-on-v-model': require('./rules/no-custom-modifiers-on-v-model'),
    'no-deprecated-data-object-declaration': require('./rules/no-deprecated-data-object-declaration'),
    'no-deprecated-delete-set': require('./rules/no-deprecated-delete-set'),
    'no-deprecated-destroyed-lifecycle': require('./rules/no-deprecated-destroyed-lifecycle'),
    'no-deprecated-dollar-listeners-api': require('./rules/no-deprecated-dollar-listeners-api'),
    'no-deprecated-dollar-scopedslots-api': require('./rules/no-deprecated-dollar-scopedslots-api'),
    'no-deprecated-events-api': require('./rules/no-deprecated-events-api'),
    'no-deprecated-filter': require('./rules/no-deprecated-filter'),
    'no-deprecated-functional-template': require('./rules/no-deprecated-functional-template'),
    'no-deprecated-html-element-is': require('./rules/no-deprecated-html-element-is'),
    'no-deprecated-inline-template': require('./rules/no-deprecated-inline-template'),
    'no-deprecated-model-definition': require('./rules/no-deprecated-model-definition'),
    'no-deprecated-props-default-this': require('./rules/no-deprecated-props-default-this'),
    'no-deprecated-router-link-tag-prop': require('./rules/no-deprecated-router-link-tag-prop'),
    'no-deprecated-scope-attribute': require('./rules/no-deprecated-scope-attribute'),
    'no-deprecated-slot-attribute': require('./rules/no-deprecated-slot-attribute'),
    'no-deprecated-slot-scope-attribute': require('./rules/no-deprecated-slot-scope-attribute'),
    'no-deprecated-v-bind-sync': require('./rules/no-deprecated-v-bind-sync'),
    'no-deprecated-v-is': require('./rules/no-deprecated-v-is'),
    'no-deprecated-v-on-native-modifier': require('./rules/no-deprecated-v-on-native-modifier'),
    'no-deprecated-v-on-number-modifiers': require('./rules/no-deprecated-v-on-number-modifiers'),
    'no-deprecated-vue-config-keycodes': require('./rules/no-deprecated-vue-config-keycodes'),
    'no-dupe-keys': require('./rules/no-dupe-keys'),
    'no-dupe-v-else-if': require('./rules/no-dupe-v-else-if'),
    'no-duplicate-attr-inheritance': require('./rules/no-duplicate-attr-inheritance'),
    'no-duplicate-attributes': require('./rules/no-duplicate-attributes'),
    'no-empty-component-block': require('./rules/no-empty-component-block'),
    'no-empty-pattern': require('./rules/no-empty-pattern'),
    'no-export-in-script-setup': require('./rules/no-export-in-script-setup'),
    'no-expose-after-await': require('./rules/no-expose-after-await'),
    'no-extra-parens': require('./rules/no-extra-parens'),
    'no-invalid-model-keys': require('./rules/no-invalid-model-keys'),
    'no-irregular-whitespace': require('./rules/no-irregular-whitespace'),
    'no-lifecycle-after-await': require('./rules/no-lifecycle-after-await'),
    'no-lone-template': require('./rules/no-lone-template'),
    'no-loss-of-precision': require('./rules/no-loss-of-precision'),
    'no-multi-spaces': require('./rules/no-multi-spaces'),
    'no-multiple-objects-in-class': require('./rules/no-multiple-objects-in-class'),
    'no-multiple-slot-args': require('./rules/no-multiple-slot-args'),
    'no-multiple-template-root': require('./rules/no-multiple-template-root'),
    'no-mutating-props': require('./rules/no-mutating-props'),
    'no-parsing-error': require('./rules/no-parsing-error'),
    'no-potential-component-option-typo': require('./rules/no-potential-component-option-typo'),
    'no-ref-as-operand': require('./rules/no-ref-as-operand'),
    'no-ref-object-destructure': require('./rules/no-ref-object-destructure'),
    'no-ref-object-reactivity-loss': require('./rules/no-ref-object-reactivity-loss'),
    'no-required-prop-with-default': require('./rules/no-required-prop-with-default'),
    'no-reserved-component-names': require('./rules/no-reserved-component-names'),
    'no-reserved-keys': require('./rules/no-reserved-keys'),
    'no-reserved-props': require('./rules/no-reserved-props'),
    'no-restricted-block': require('./rules/no-restricted-block'),
    'no-restricted-call-after-await': require('./rules/no-restricted-call-after-await'),
    'no-restricted-class': require('./rules/no-restricted-class'),
    'no-restricted-component-names': require('./rules/no-restricted-component-names'),
    'no-restricted-component-options': require('./rules/no-restricted-component-options'),
    'no-restricted-custom-event': require('./rules/no-restricted-custom-event'),
    'no-restricted-html-elements': require('./rules/no-restricted-html-elements'),
    'no-restricted-props': require('./rules/no-restricted-props'),
    'no-restricted-static-attribute': require('./rules/no-restricted-static-attribute'),
    'no-restricted-syntax': require('./rules/no-restricted-syntax'),
    'no-restricted-v-bind': require('./rules/no-restricted-v-bind'),
    'no-restricted-v-on': require('./rules/no-restricted-v-on'),
    'no-root-v-if': require('./rules/no-root-v-if'),
    'no-setup-props-destructure': require('./rules/no-setup-props-destructure'),
    'no-setup-props-reactivity-loss': require('./rules/no-setup-props-reactivity-loss'),
    'no-shared-component-data': require('./rules/no-shared-component-data'),
    'no-side-effects-in-computed-properties': require('./rules/no-side-effects-in-computed-properties'),
    'no-spaces-around-equal-signs-in-attribute': require('./rules/no-spaces-around-equal-signs-in-attribute'),
    'no-sparse-arrays': require('./rules/no-sparse-arrays'),
    'no-static-inline-styles': require('./rules/no-static-inline-styles'),
    'no-template-key': require('./rules/no-template-key'),
    'no-template-shadow': require('./rules/no-template-shadow'),
    'no-template-target-blank': require('./rules/no-template-target-blank'),
    'no-textarea-mustache': require('./rules/no-textarea-mustache'),
    'no-this-in-before-route-enter': require('./rules/no-this-in-before-route-enter'),
    'no-undef-components': require('./rules/no-undef-components'),
    'no-undef-properties': require('./rules/no-undef-properties'),
    'no-unsupported-features': require('./rules/no-unsupported-features'),
    'no-unused-components': require('./rules/no-unused-components'),
    'no-unused-emit-declarations': require('./rules/no-unused-emit-declarations'),
    'no-unused-properties': require('./rules/no-unused-properties'),
    'no-unused-refs': require('./rules/no-unused-refs'),
    'no-unused-vars': require('./rules/no-unused-vars'),
    'no-use-computed-property-like-method': require('./rules/no-use-computed-property-like-method'),
    'no-use-v-else-with-v-for': require('./rules/no-use-v-else-with-v-for'),
    'no-use-v-if-with-v-for': require('./rules/no-use-v-if-with-v-for'),
    'no-useless-concat': require('./rules/no-useless-concat'),
    'no-useless-mustaches': require('./rules/no-useless-mustaches'),
    'no-useless-template-attributes': require('./rules/no-useless-template-attributes'),
    'no-useless-v-bind': require('./rules/no-useless-v-bind'),
    'no-v-for-template-key-on-child': require('./rules/no-v-for-template-key-on-child'),
    'no-v-for-template-key': require('./rules/no-v-for-template-key'),
    'no-v-html': require('./rules/no-v-html'),
    'no-v-model-argument': require('./rules/no-v-model-argument'),
    'no-v-text-v-html-on-component': require('./rules/no-v-text-v-html-on-component'),
    'no-v-text': require('./rules/no-v-text'),
    'no-watch-after-await': require('./rules/no-watch-after-await'),
    'object-curly-newline': require('./rules/object-curly-newline'),
    'object-curly-spacing': require('./rules/object-curly-spacing'),
    'object-property-newline': require('./rules/object-property-newline'),
    'object-shorthand': require('./rules/object-shorthand'),
    'one-component-per-file': require('./rules/one-component-per-file'),
    'operator-linebreak': require('./rules/operator-linebreak'),
    'order-in-components': require('./rules/order-in-components'),
    'padding-line-between-blocks': require('./rules/padding-line-between-blocks'),
    'padding-line-between-tags': require('./rules/padding-line-between-tags'),
    'padding-lines-in-component-definition': require('./rules/padding-lines-in-component-definition'),
    'prefer-define-options': require('./rules/prefer-define-options'),
    'prefer-import-from-vue': require('./rules/prefer-import-from-vue'),
    'prefer-prop-type-boolean-first': require('./rules/prefer-prop-type-boolean-first'),
    'prefer-separate-static-class': require('./rules/prefer-separate-static-class'),
    'prefer-template': require('./rules/prefer-template'),
    'prefer-true-attribute-shorthand': require('./rules/prefer-true-attribute-shorthand'),
    'prop-name-casing': require('./rules/prop-name-casing'),
    'quote-props': require('./rules/quote-props'),
    'require-component-is': require('./rules/require-component-is'),
    'require-default-export': require('./rules/require-default-export'),
    'require-default-prop': require('./rules/require-default-prop'),
    'require-direct-export': require('./rules/require-direct-export'),
    'require-emit-validator': require('./rules/require-emit-validator'),
    'require-explicit-emits': require('./rules/require-explicit-emits'),
    'require-explicit-slots': require('./rules/require-explicit-slots'),
    'require-expose': require('./rules/require-expose'),
    'require-macro-variable-name': require('./rules/require-macro-variable-name'),
    'require-name-property': require('./rules/require-name-property'),
    'require-prop-comment': require('./rules/require-prop-comment'),
    'require-prop-type-constructor': require('./rules/require-prop-type-constructor'),
    'require-prop-types': require('./rules/require-prop-types'),
    'require-render-return': require('./rules/require-render-return'),
    'require-slots-as-functions': require('./rules/require-slots-as-functions'),
    'require-toggle-inside-transition': require('./rules/require-toggle-inside-transition'),
    'require-typed-object-prop': require('./rules/require-typed-object-prop'),
    'require-typed-ref': require('./rules/require-typed-ref'),
    'require-v-for-key': require('./rules/require-v-for-key'),
    'require-valid-default-prop': require('./rules/require-valid-default-prop'),
    'return-in-computed-property': require('./rules/return-in-computed-property'),
    'return-in-emits-validator': require('./rules/return-in-emits-validator'),
    'script-indent': require('./rules/script-indent'),
    'script-setup-uses-vars': require('./rules/script-setup-uses-vars'),
    'singleline-html-element-content-newline': require('./rules/singleline-html-element-content-newline'),
    'sort-keys': require('./rules/sort-keys'),
    'space-in-parens': require('./rules/space-in-parens'),
    'space-infix-ops': require('./rules/space-infix-ops'),
    'space-unary-ops': require('./rules/space-unary-ops'),
    'static-class-names-order': require('./rules/static-class-names-order'),
    'template-curly-spacing': require('./rules/template-curly-spacing'),
    'this-in-template': require('./rules/this-in-template'),
    'use-v-on-exact': require('./rules/use-v-on-exact'),
    'v-bind-style': require('./rules/v-bind-style'),
    'v-for-delimiter-style': require('./rules/v-for-delimiter-style'),
    'v-if-else-key': require('./rules/v-if-else-key'),
    'v-on-event-hyphenation': require('./rules/v-on-event-hyphenation'),
    'v-on-function-call': require('./rules/v-on-function-call'),
    'v-on-handler-style': require('./rules/v-on-handler-style'),
    'v-on-style': require('./rules/v-on-style'),
    'v-slot-style': require('./rules/v-slot-style'),
    'valid-attribute-name': require('./rules/valid-attribute-name'),
    'valid-define-emits': require('./rules/valid-define-emits'),
    'valid-define-options': require('./rules/valid-define-options'),
    'valid-define-props': require('./rules/valid-define-props'),
    'valid-model-definition': require('./rules/valid-model-definition'),
    'valid-next-tick': require('./rules/valid-next-tick'),
    'valid-template-root': require('./rules/valid-template-root'),
    'valid-v-bind-sync': require('./rules/valid-v-bind-sync'),
    'valid-v-bind': require('./rules/valid-v-bind'),
    'valid-v-cloak': require('./rules/valid-v-cloak'),
    'valid-v-else-if': require('./rules/valid-v-else-if'),
    'valid-v-else': require('./rules/valid-v-else'),
    'valid-v-for': require('./rules/valid-v-for'),
    'valid-v-html': require('./rules/valid-v-html'),
    'valid-v-if': require('./rules/valid-v-if'),
    'valid-v-is': require('./rules/valid-v-is'),
    'valid-v-memo': require('./rules/valid-v-memo'),
    'valid-v-model': require('./rules/valid-v-model'),
    'valid-v-on': require('./rules/valid-v-on'),
    'valid-v-once': require('./rules/valid-v-once'),
    'valid-v-pre': require('./rules/valid-v-pre'),
    'valid-v-show': require('./rules/valid-v-show'),
    'valid-v-slot': require('./rules/valid-v-slot'),
    'valid-v-text': require('./rules/valid-v-text')
  },
  processors: {
    '.vue': require('./processor'),
    vue: require('./processor')
  },
  environments: {
    // TODO Remove in the next major version
    /** @deprecated */
    'setup-compiler-macros': {
      globals: {
        defineProps: 'readonly',
        defineEmits: 'readonly',
        defineExpose: 'readonly',
        withDefaults: 'readonly'
      }
    }
  }
}

module.exports = plugin


code:
'use strict'
const { name, version } = require('../package.json')
module.exports = { name, version }


code:
/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 */
'use strict'

/**
 * @typedef {import('eslint').Linter.LintMessage} LintMessage
 */
/**
 * @typedef {object} GroupState
 * @property {Set<string>} GroupState.disableAllKeys
 * @property {Map<string, string[]>} GroupState.disableRuleKeys
 */

module.exports = {
  /** @param {string} code */
  preprocess(code) {
    return [code]
  },

  /**
   * @param {LintMessage[][]} messages
   * @returns {LintMessage[]}
   */
  postprocess(messages) {
    const state = {
      /** @type {GroupState} */
      block: {
        disableAllKeys: new Set(),
        disableRuleKeys: new Map()
      },
      /** @type {GroupState} */
      line: {
        disableAllKeys: new Set(),
        disableRuleKeys: new Map()
      }
    }
    /** @type {string[]} */
    const usedDisableDirectiveKeys = []
    /** @type {Map<string,LintMessage>} */
    const unusedDisableDirectiveReports = new Map()

    // Filter messages which are in disabled area.
    const filteredMessages = messages[0].filter((message) => {
      if (message.ruleId === 'vue/comment-directive') {
        const directiveType = message.messageId
        const data = message.message.split(' ')
        switch (directiveType) {
          case 'disableBlock': {
            state.block.disableAllKeys.add(data[1])
            break
          }
          case 'disableLine': {
            state.line.disableAllKeys.add(data[1])
            break
          }
          case 'enableBlock': {
            state.block.disableAllKeys.clear()
            break
          }
          case 'enableLine': {
            state.line.disableAllKeys.clear()
            break
          }
          case 'disableBlockRule': {
            addDisableRule(state.block.disableRuleKeys, data[1], data[2])
            break
          }
          case 'disableLineRule': {
            addDisableRule(state.line.disableRuleKeys, data[1], data[2])
            break
          }
          case 'enableBlockRule': {
            state.block.disableRuleKeys.delete(data[1])
            break
          }
          case 'enableLineRule': {
            state.line.disableRuleKeys.delete(data[1])
            break
          }
          case 'clear': {
            state.block.disableAllKeys.clear()
            state.block.disableRuleKeys.clear()
            state.line.disableAllKeys.clear()
            state.line.disableRuleKeys.clear()
            break
          }
          default: {
            // unused eslint-disable comments report
            unusedDisableDirectiveReports.set(messageToKey(message), message)
            break
          }
        }
        return false
      } else {
        const disableDirectiveKeys = []
        if (state.block.disableAllKeys.size > 0) {
          disableDirectiveKeys.push(...state.block.disableAllKeys)
        }
        if (state.line.disableAllKeys.size > 0) {
          disableDirectiveKeys.push(...state.line.disableAllKeys)
        }
        if (message.ruleId) {
          const block = state.block.disableRuleKeys.get(message.ruleId)
          if (block) {
            disableDirectiveKeys.push(...block)
          }
          const line = state.line.disableRuleKeys.get(message.ruleId)
          if (line) {
            disableDirectiveKeys.push(...line)
          }
        }

        if (disableDirectiveKeys.length > 0) {
          // Store used eslint-disable comment key
          usedDisableDirectiveKeys.push(...disableDirectiveKeys)
          return false
        } else {
          return true
        }
      }
    })

    if (unusedDisableDirectiveReports.size > 0) {
      for (const key of usedDisableDirectiveKeys) {
        // Remove used eslint-disable comments
        unusedDisableDirectiveReports.delete(key)
      }
      // Reports unused eslint-disable comments
      filteredMessages.push(...unusedDisableDirectiveReports.values())
      filteredMessages.sort(compareLocations)
    }

    return filteredMessages
  },

  supportsAutofix: true,

  meta: require('./meta')
}

/**
 * @param {Map<string, string[]>} disableRuleKeys
 * @param {string} rule
 * @param {string} key
 */
function addDisableRule(disableRuleKeys, rule, key) {
  let keys = disableRuleKeys.get(rule)
  if (keys) {
    keys.push(key)
  } else {
    keys = [key]
    disableRuleKeys.set(rule, keys)
  }
}

/**
 * @param {LintMessage} message
 * @returns {string} message key
 */
function messageToKey(message) {
  return `line:${message.line},column${
    // -1 because +1 by ESLint's `report-translator`.
    message.column - 1
  }`
}

/**
 * Compares the locations of two objects in a source file
 * @param {Position} itemA The first object
 * @param {Position} itemB The second object
 * @returns {number} A value less than 1 if itemA appears before itemB in the source file, greater than 1 if
 * itemA appears after itemB in the source file, or 0 if itemA and itemB have the same location.
 */
function compareLocations(itemA, itemB) {
  return itemA.line - itemB.line || itemA.column - itemB.column
}


code:
'use strict'

/**
 * @typedef {object} RemovedRule
 * @property {string} ruleName
 * @property {string[]} replacedBy
 * @property {string} deprecatedInVersion
 * @property {string} removedInVersion
 */

/** @type {RemovedRule[]} */
module.exports = [
  {
    ruleName: 'experimental-script-setup-vars',
    replacedBy: [],
    deprecatedInVersion: 'v7.13.0',
    removedInVersion: 'v9.0.0'
  },
  {
    ruleName: 'name-property-casing',
    replacedBy: ['component-definition-name-casing'],
    deprecatedInVersion: 'v7.0.0',
    removedInVersion: 'v9.0.0'
  },
  {
    ruleName: 'no-confusing-v-for-v-if',
    replacedBy: ['no-use-v-if-with-v-for'],
    deprecatedInVersion: 'v5.0.0',
    removedInVersion: 'v9.0.0'
  },
  {
    ruleName: 'no-unregistered-components',
    replacedBy: ['no-undef-components'],
    deprecatedInVersion: 'v8.4.0',
    removedInVersion: 'v9.0.0'
  }
]


code:
/**
 * @author Yosuke Ota
 */
'use strict'

const { wrapStylisticOrCoreRule } = require('../utils')

// eslint-disable-next-line internal/no-invalid-meta
module.exports = wrapStylisticOrCoreRule('array-bracket-newline', {
  skipDynamicArguments: true
})


code:
/**
 * @author Toru Nagashima
 */
'use strict'

const { wrapStylisticOrCoreRule } = require('../utils')

// eslint-disable-next-line internal/no-invalid-meta
module.exports = wrapStylisticOrCoreRule('array-bracket-spacing', {
  skipDynamicArguments: true
})


code:
/**
 * @author alshyra
 */
'use strict'

const { wrapStylisticOrCoreRule } = require('../utils')

// eslint-disable-next-line internal/no-invalid-meta
module.exports = wrapStylisticOrCoreRule('array-element-newline', {
  skipDynamicArguments: true
})


code:
/**
 * @author Yosuke Ota
 */
'use strict'

const { wrapStylisticOrCoreRule } = require('../utils')

// eslint-disable-next-line internal/no-invalid-meta
module.exports = wrapStylisticOrCoreRule('arrow-spacing')


code:
/**
 * @fileoverview Define a style for the props casing in templates.
 * @author Armano
 */
'use strict'

const utils = require('../utils')
const casing = require('../utils/casing')
const svgAttributes = require('../utils/svg-attributes-weird-case.json')

/**
 * @param {VDirective | VAttribute} node
 * @returns {string | null}
 */
function getAttributeName(node) {
  if (!node.directive) {
    return node.key.rawName
  }

  if (
    (node.key.name.name === 'bind' || node.key.name.name === 'model') &&
    node.key.argument &&
    node.key.argument.type === 'VIdentifier'
  ) {
    return node.key.argument.rawName
  }

  return null
}

module.exports = {
  meta: {
    type: 'suggestion',
    docs: {
      description:
        'enforce attribute naming style on custom components in template',
      categories: ['vue3-strongly-recommended', 'vue2-strongly-recommended'],
      url: 'https://eslint.vuejs.org/rules/attribute-hyphenation.html'
    },
    fixable: 'code',
    schema: [
      {
        enum: ['always', 'never']
      },
      {
        type: 'object',
        properties: {
          ignore: {
            type: 'array',
            items: {
              allOf: [
                { type: 'string' },
                { not: { type: 'string', pattern: ':exit$' } },
                { not: { type: 'string', pattern: String.raw`^\s*$` } }
              ]
            },
            uniqueItems: true,
            additionalItems: false
          }
        },
        additionalProperties: false
      }
    ],
    messages: {
      mustBeHyphenated: "Attribute '{{text}}' must be hyphenated.",
      cannotBeHyphenated: "Attribute '{{text}}' can't be hyphenated."
    }
  },
  /** @param {RuleContext} context */
  create(context) {
    const sourceCode = context.getSourceCode()
    const option = context.options[0]
    const optionsPayload = context.options[1]
    const useHyphenated = option !== 'never'
    const ignoredAttributes = ['data-', 'aria-', 'slot-scope', ...svgAttributes]

    if (optionsPayload && optionsPayload.ignore) {
      ignoredAttributes.push(...optionsPayload.ignore)
    }

    const caseConverter = casing.getExactConverter(
      useHyphenated ? 'kebab-case' : 'camelCase'
    )

    /**
     * @param {VDirective | VAttribute} node
     * @param {string} name
     */
    function reportIssue(node, name) {
      const text = sourceCode.getText(node.key)

      context.report({
        node: node.key,
        loc: node.loc,
        messageId: useHyphenated ? 'mustBeHyphenated' : 'cannotBeHyphenated',
        data: {
          text
        },
        fix: (fixer) => {
          if (text.includes('_')) {
            return null
          }

          if (text.endsWith('.sync')) {
            return null
          }

          if (/^[A-Z]/.test(name)) {
            return null
          }

          return fixer.replaceText(
            node.key,
            text.replace(name, caseConverter(name))
          )
        }
      })
    }

    /**
     * @param {string} value
     */
    function isIgnoredAttribute(value) {
      const isIgnored = ignoredAttributes.some((attr) => value.includes(attr))

      if (isIgnored) {
        return true
      }

      return useHyphenated ? value.toLowerCase() === value : !/-/.test(value)
    }

    return utils.defineTemplateBodyVisitor(context, {
      VAttribute(node) {
        if (
          !utils.isCustomComponent(node.parent.parent) &&
          node.parent.parent.name !== 'slot'
        )
          return

        const name = getAttributeName(node)
        if (name === null || isIgnoredAttribute(name)) return

        reportIssue(node, name)
      }
    })
  }
}