Giter Site home page Giter Site logo

configs's People

Contributors

driftingly avatar mattstauffer avatar rissajackson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

configs's Issues

Consider adding ESLint to get Vue Config

Right now we only recommend prettier:

    "prettier": {
        "singleQuote": true,
        "trailingComma": "es5",
        "tabWidth": 4,
        "printWidth": 80
    }

@jonsugar mentioned we may want to add some ESLint configurations in order to apply some of our other preferences, like "follow Vue's conventions".

Can we add this stuff to Prettier? Or is it only viable in ESlint? And if only in ESlint, can we move our Prettier config to ESlint so we only have one tool? Or are we stuck with two tools?

This is @jonsugar's config:

module.exports = {
    env: {
        browser: true,
        es2021: true,
    },
    extends: [
        'eslint:recommended',
        'plugin:vue/recommended',
        'airbnb-base',
    ],
    parserOptions: {
        ecmaVersion: 12,
        parser: '@typescript-eslint/parser',
        sourceType: 'module',
    },
    plugins: [
        'vue',
        '@typescript-eslint',
    ],
    rules: {

        // ESLint -----------------------------------------------------------------

        indent: ['error', 4],

        'global-require': 'off',
        'import/extensions': 'off',
        'object-shorthand': 'off',
        'max-len': [
            'error', {
                code: 120,
                ignoreComments: true,
                ignoreTrailingComments: true,
                ignoreUrls: true,
                ignoreStrings: true,
                ignoreTemplateLiterals: false,
                ignoreRegExpLiterals: false,
                ignorePattern: 'class=".+"',
            },
        ],

        // TypeScript -------------------------------------------------------------

        'no-shadow': 'off',
        '@typescript-eslint/no-shadow': 'error',

        'no-unused-vars': 'off',
        '@typescript-eslint/no-unused-vars-experimental': 'error',
        '@typescript-eslint/no-unused-vars': 'off',

        'no-empty-function': 'off',
        '@typescript-eslint/no-empty-function': [
            'error', {
                allow: ['private-constructors'],
            },
        ],

        'no-redeclare': 'off',
        '@typescript-eslint/no-redeclare': 'error',

        // Classes ----------------------------------------------------------------

        'class-methods-use-this': 'off',
        'no-useless-constructor': 'off',
        '@typescript-eslint/no-useless-constructor': 'error',

        'max-classes-per-file': 'warn',
        'lines-between-class-members': 'off',
        'no-underscore-dangle': 'off',

        // Vue 3 ---------------------------------------------------------------

        'vue/html-indent': ['error', 4, {
            attribute: 1,
            baseIndent: 1,
            closeBracket: 0,
            alignAttributesVertically: true,
            ignores: [],
        }],

        'vue/no-multiple-template-root': 'off',

        'vue/max-len': ['error', {
            code: 120,
            ignoreComments: true,
            ignoreTrailingComments: true,
            ignoreUrls: true,
            ignoreStrings: true,
            ignoreTemplateLiterals: true,
            ignoreRegExpLiterals: true,
            ignoreHTMLAttributeValues: true,
            ignoreHTMLTextContents: false,
        }],
    },

    settings: {
        'import/resolver': {
            node: {
                extensions: ['.js', '.jsx', '.ts', '.tsx', '.vue'],
            },
        },
    },
};

And this is one @calebporzio wrote on a project for us a few years back:

{
    "extends": "plugin:vue/recommended",
    "parserOptions": {
        "ecmaVersion": 8,
        "sourceType": "module"
    },
    "rules": {
        "semi": [2, "never"],
        "indent": [2, 4],
        "eol-last": [2, "always"],
        "linebreak-style": [2, "unix"],
        "vue/max-attributes-per-line": [2, { "singleline": 2 }],
        "vue/html-indent": [2, 4, { "closeBracket": 0, "attribute": 1 }],
        "vue/script-indent": [2, 4],
        "vue/require-default-prop": 0,
        "vue/require-prop-types": 0,
        "vue/html-closing-bracket-newline": [
            2,
            { "multiline": "always" }
        ]
    }
}

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.