npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

eslint-config-xdevel

v1.0.14

Published

Configurações ESLint para projetos da xDevel

Downloads

2

Readme

eslint-config-xdevel

Build Status

Configurações ESLint para projetos do xDevel baseados no modelo da Prodest

Garante que o código adere ao coding style da xDevel realizando o linting do código usando ESLint.

Coding Style: eslint-config-idiomatic + customizações

eslint-config-xdevel é amplamente baseado nas regras de estilo de código idiomatic js, definidas como regras ESLint no arquivo de configuração eslint-config-idiomatic.

Exemplo de código com estilo Idiomatic:

const thing = 'Hello',
  another = 'World';

function idiomatic( arg ) {
  let out = 'Bye';
  if ( !arg ) {
    out = thing;
  } else if ( arg === thing ) {
    out = another;
  }
  return out;
}

O que arquivo de configuração (eslint-config-xdevel) faz é:

Instalação

npm i --save-dev eslint-config-xdevel

Uso

Em seu arquivo .eslintrc:

{
  "extends": "xdevel"
}

Regras

Segue a seguir a listagem com todas as regras do ESLint configuradas por eslint-config-xdevel:

"rules": {

    // Regras herdadas do estilo *idiomatic*
     
    "array-bracket-spacing": [2, "always"],
    "arrow-spacing": [2, { "before": true, "after": true }],
    "block-spacing": [2, "always"],
    "brace-style": [2, "1tbs", { "allowSingleLine": false }],
    "comma-spacing": [2, {"before": false, "after": true}],
    "comma-style": [2, "last"],
    "curly": [2, "all"],
    "dot-location": [2, "property"],
    "eol-last": [2],
    "func-names": [1],
    "key-spacing": [2, { "beforeColon": false, "afterColon": true }],
    "keyword-spacing": [2],
    "linebreak-style": [2],
    "no-func-assign": [2],
    "no-inline-comments": [2],
    "no-mixed-spaces-and-tabs": [2],
    "no-multi-spaces": [2],
    "no-spaced-func": [2],
    "no-trailing-spaces": [2],
    "object-curly-spacing": [2, "always"],
    "one-var": [2, "always"],
    "one-var-declaration-per-line": [2, "always"],
    "quotes": [2, "single"],
    "semi-spacing": [2, {"before": false, "after": true}],
    "space-before-blocks": [2],
    "space-before-function-paren": [2, "never"],
    "space-in-parens": [2, "always"],
    "space-infix-ops": [2],
    "space-unary-ops": [2, { "words": true, "nonwords": false }],
    "vars-on-top": [2],
    "comma-dangle": [2, "never"],
    "complexity": [1, 10],
    "dot-notation": [2, { "allowKeywords": false }],
    "eqeqeq": [2],
    "new-parens": [2],
    "no-alert": [2],
    "no-array-constructor": [2],
    "no-catch-shadow": [2],
    "no-cond-assign": [2],
    "no-constant-condition": [2],
    "no-control-regex": [2],
    "no-debugger": [2],
    "no-delete-var": [2],
    "no-div-regex": [2],
    "no-dupe-args": [2],
    "no-dupe-keys": [2],
    "no-duplicate-case": [2],
    "no-empty": [2],
    "no-empty-character-class": [2],
    "no-eq-null": [2],
    "no-eval": [2],
    "no-ex-assign": [2],
    "no-extend-native": [2],
    "no-extra-bind": [2],
    "no-extra-boolean-cast": [2],
    "no-extra-semi": [2],
    "no-fallthrough": [2],
    "no-floating-decimal": [2],
    "no-func-assign": [2],
    "no-implied-eval": [2],
    "no-inner-declarations": [2],
    "no-invalid-regexp": [2],
    "no-invalid-this": [2],
    "no-irregular-whitespace": [2],
    "no-iterator": [2],
    "no-labels": [2],
    "no-lone-blocks": [2],
    "no-lonely-if": [2],
    "no-loop-func": [2],
    "no-multi-str": [2],
    "no-native-reassign": [2],
    "no-negated-in-lhs": [2],
    "no-new": [2],
    "no-new-func": [2],
    "no-new-object": [2],
    "no-new-wrappers": [2],
    "no-obj-calls": [2],
    "no-octal": [2],
    "no-octal-escape": [2],
    "no-param-reassign": [2],
    "no-redeclare": [2],
    "no-regex-spaces": [2],
    "no-return-assign": [2],
    "no-script-url": [2],
    "no-self-compare": [2],
    "no-sequences": [2],
    "no-shadow": [2],
    "no-shadow-restricted-names": [2],
    "no-sparse-arrays": [2],
    "no-throw-literal": [2],
    "no-undef": [2],
    "no-unneeded-ternary": [2],
    "no-unreachable": [2],
    "no-unused-expressions": [2],
    "no-unused-vars": [2],
    "no-useless-concat": [2],
    "no-void": [2],
    "no-warning-comments": [ 1, { "terms": [ "todo", "fixme" ], "location": "anywhere" } ],
    "no-with": [2],
    "radix": [2],
    "use-isnan": [2],
    "valid-typeof": [2],
    


    //Customizações que eslint-config-xdevel aplica (sobrescreve) às regras do estilo *idiomatic*

    "indent": [1, 2],
    "computed-property-spacing": [0] 
    "valid-jsdoc": 1,
    "dot-notation": [2, {
        "allowKeywords": true
    }],
    "linebreak-style": [2, "windows"],
    "indent": [1, 4],
    "no-inline-comments": 0,
    "func-names": 0,
    "semi": [2, "always"],
    "one-var": [2, {
        "uninitialized": "never",
        "initialized": "never"
    }],
    "no-unused-expressions": [2, {
        "allowShortCircuit": true
    }]

  }

Overrides

Você pode facilmente sobrescrever regras de eslint-config-xdevel em seu próprio arquivo .eslintrc. Por exemplo, para usar identação com 2 espaços ao invés de 4(padrão), use:

{
  "extends": "xdevel",
  "rules": {
    "indent": [2, 2]
  }
}

ES5

eslint-config-xdevel é ES6+ por padrão. Para usar ES5, extenda xdevel/es5 em seu arquivo .eslintrc:

{
  "extends": "xdevel/es5"
}