eslint-config-trails
Advanced tools
Comparing version 3.0.0-pre to 3.0.0-pre.1
34
index.js
module.exports = { | ||
extends: [ | ||
'eslint-config-trails/rules/recommended', | ||
'eslint-config-trails/rules/node', | ||
'eslint-config-trails/rules/style', | ||
'eslint-config-trails/rules/es6' | ||
], | ||
extends: require.resolve('./rules/style'), | ||
env: { | ||
node: true, | ||
es6: true | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 8 | ||
}, | ||
globals: { | ||
@@ -27,3 +30,20 @@ // error types | ||
Model: true | ||
}, | ||
rules: { | ||
'no-console': 2, | ||
'no-global-assign': 2, | ||
// disallow modifying variables that are declared using const | ||
'no-const-assign': 2, | ||
// require let or const instead of var | ||
'no-var': 2, | ||
// suggest using of const declaration for variables that are never modified after declared | ||
'prefer-const': 1, | ||
// trails exposes process.env as trails.env | ||
'no-process-env': 2 | ||
} | ||
}; | ||
} |
{ | ||
"name": "eslint-config-trails", | ||
"version": "3.0.0-pre", | ||
"version": "3.0.0-pre.1", | ||
"description": "Trails.js eslint config", | ||
@@ -23,3 +23,6 @@ "main": "index.js", | ||
}, | ||
"homepage": "https://github.com/trailsjs/eslint-config-trails" | ||
"homepage": "https://github.com/trailsjs/eslint-config-trails", | ||
"devDependencies": { | ||
"eslint": "^3.18.0" | ||
} | ||
} |
module.exports = { | ||
extends: [ | ||
'eslint-config-trails/index', | ||
'eslint-config-trails/rules/react' | ||
], | ||
extends: require.resolve('./'), | ||
rules: { | ||
@@ -16,2 +14,2 @@ 'no-console': 1, | ||
} | ||
}; | ||
} |
module.exports = { | ||
'env': { | ||
'browser': true | ||
env: { | ||
browser: true | ||
}, | ||
'plugins': ['react'], | ||
'ecmaFeatures': { | ||
'jsx': true | ||
plugins: ['react'], | ||
ecmaFeatures: { | ||
jsx: true | ||
}, | ||
'rules': { | ||
rules: { | ||
// Enforce boolean attributes notation in JSX | ||
'react/jsx-boolean-value': 2, | ||
// Disallow undeclared variables in JSX | ||
'react/jsx-no-undef': 2, | ||
// Prevent React to be incorrectly marked as unused | ||
'react/jsx-uses-react': 2, | ||
// Prevent variables used in JSX to be incorrectly marked as unused | ||
'react/jsx-uses-vars': 2, | ||
// Prevent usage of setState in componentDidMount | ||
'react/no-unknown-property': 2, | ||
// Prevent missing props validation in a React component definition | ||
'react/prop-types': 2, | ||
// Prevent missing React when using JSX | ||
'react/react-in-jsx-scope': 2, | ||
// Prevent missing parentheses around multilines JSX | ||
'react/jsx-wrap-multilines': 2, | ||
// specify whether double or single quotes should be used in JSX attributes | ||
'jsx-quotes': 2 | ||
} | ||
}; | ||
} |
module.exports = { | ||
extends: 'eslint:recommended', | ||
rules: { | ||
// enforce one true brace style | ||
'brace-style': [2, 'stroustrup', {'allowSingleLine': true }], | ||
// require camel case names | ||
'camelcase': [2, {'properties': 'never'}], | ||
// enforce one true comma style | ||
'comma-style': [2, 'last'], | ||
// enforce newline at the end of file, with no multiple empty lines | ||
'eol-last': 2, | ||
// enforces spacing between keys and values in object literal properties | ||
'key-spacing': [2, {'beforeColon': false, 'afterColon': true}], | ||
// require a capital letter for constructors | ||
'new-cap': [2, {'newIsCap': true}], | ||
// disallow mixed spaces and tabs for indentation | ||
'no-mixed-spaces-and-tabs': 2, | ||
// disallow trailing whitespace at the end of lines | ||
'no-trailing-spaces': 2, | ||
// disallow dangling underscores in identifiers | ||
'no-underscore-dangle': [2, { 'allowAfterThis': true, 'allow': [ '__', '_trails' ] }], | ||
// disallow declaration of variables that are not used in the code | ||
'no-unused-vars': [2, {'vars': 'local', 'args': 'none'}], | ||
// specify whether double or single quotes should be used | ||
'quotes': [2, 'single', 'avoid-escape'], | ||
// enforce that semicolons are never used | ||
'semi': [2, 'never'], | ||
// require spaces around operators | ||
'space-infix-ops': 2, | ||
// require spaces following keywords | ||
'keyword-spacing': 2, | ||
// warn when line length is greater than 80 characters | ||
'max-len': [1, 100, 2, { 'ignoreComments': true, 'ignoreUrls': true, 'tabWidth': 2 }], | ||
// 2-space indentation | ||
@@ -34,0 +51,0 @@ 'indent': ['error', 2] |
module.exports = { | ||
'env': { | ||
'mocha': true, | ||
'jest': true | ||
}, | ||
rules: { | ||
'no-console': 0, | ||
'max-len': [1, 160, 2, { 'ignoreComments': true, 'ignoreUrls': true, 'tabWidth': 2 }], | ||
'no-unused-vars': [1, {'vars': 'local', 'args': 'none'}] | ||
} | ||
}; | ||
18
test.js
module.exports = { | ||
extends: [ | ||
'eslint-config-trails/index', | ||
'eslint-config-trails/rules/test' | ||
] | ||
}; | ||
extends: require.resolve('./'), | ||
env: { | ||
mocha: true, | ||
jest: true | ||
}, | ||
rules: { | ||
'no-console': 0, | ||
'no-process-env': 0, | ||
'max-len': [1, 160, 2, { 'ignoreComments': true, 'ignoreUrls': true, 'tabWidth': 2 }], | ||
'no-unused-vars': [1, {'vars': 'local', 'args': 'none'}] | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9678
1
12
135