Code Monkey home page Code Monkey logo

prettier-plugin-vue-component-options's Introduction

prettier-plugin-vue-component-options

prettier-plugin-vue-component-options is a lightweight JavaScript plugin for sorting Vue component options in a specific order. It is a prettier plugin that sorts the following options:

  • name
  • mixins
  • components
  • directives
  • filters
  • model
  • emits
  • props
  • setup
  • data
  • computed
  • methods
  • watch
  • beforeCreate
  • created
  • beforeMount
  • mounted
  • beforeUpdate
  • updated
  • beforeDestroy
  • destroyed
  • beforeRouteLeave

This package is useful for developers who prefer to have their component options organized in a specific way, making it easier to read and maintain their code.

Installation

You can install prettier-plugin-vue-component-options via npm or yarn.

npm install prettier-plugin-vue-component-options --save-dev

yarn add prettier-plugin-vue-component-options --dev

Usage

Once prettier-plugin-vue-component-options is installed, you can use it as a prettier plugin to format your Vue component files. To change the order as desired, add the following configuration to your prettier.config.js file:

module.exports = {
// ...
  optionOrder: [/* your own order */],
};

This will sort your Vue component options in the order specified in the optionOrder array. If an option is not included in the array, it will be sorted alphabetically after the specified options.

Contributing

Pull requests and issues are welcome. If you have any feature requests or bug reports, please open an issue on the GitHub repository.

License

prettier-plugin-vue-component-options is licensed under the MIT License. See the LICENSE file for more information.

prettier-plugin-vue-component-options's People

Contributors

yhancsx avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.