-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refonte majeure de eslint-config-udes (#10)
- Loading branch information
1 parent
969f569
commit bf56d5f
Showing
13 changed files
with
1,004 additions
and
458 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
max_line_length = 120 | ||
trim_trailing_whitespace = true | ||
|
||
[*.php] | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
module.exports = { | ||
// Extends the UdeS ESLint config | ||
extends: [ | ||
'./index.js', | ||
], | ||
} | ||
|
||
// Defines global variables that are predefined | ||
env: { | ||
// Node.js global variables and Node.js scoping | ||
node: true, | ||
}, | ||
|
||
// Limit ESLint to a specific project | ||
root: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,87 @@ | ||
module.exports = { | ||
// Extends the JavaScript Standard Style | ||
extends: ['eslint-config-standard'], | ||
extends: [ | ||
'eslint:recommended', | ||
'google', | ||
], | ||
|
||
// Supported JavaScript language options | ||
parserOptions: { | ||
// Enables ES6/ES2015 syntax | ||
ecmaVersion: 6, | ||
}, | ||
|
||
// Defines global variables that are predefined | ||
env: { | ||
// Browser global variables | ||
browser: true, | ||
|
||
// Enable ES6 features (automatically sets the ecmaVersion parser option to 6) | ||
es6: true, | ||
|
||
// Node.js global variables and Node.js scoping | ||
node: true, | ||
}, | ||
|
||
// Use of third-party plugins | ||
plugins: [ | ||
// Allows linting and fixing inline scripts contained in HTML files | ||
'eslint-plugin-html', | ||
|
||
// Lint JSON files | ||
'eslint-plugin-json', | ||
|
||
// Lint markdown files | ||
'eslint-plugin-markdown', | ||
], | ||
|
||
// Custom rules | ||
rules: { | ||
// Enforces parentheses around arrow function parameters regardless of arity | ||
'arrow-parens': [ | ||
'error', 'as-needed', { | ||
// Require parens if the function body is in an instructions block | ||
requireForBlockBody: true, | ||
}], | ||
|
||
// Requires trailing commas when the last element or property is in a different line than the closing ] or } | ||
'comma-dangle': ['error', { | ||
'arrays': 'always-multiline', // let [a,] = [1,] | ||
'exports': 'always-multiline', // export {a,} | ||
'comma-dangle': [ | ||
'error', { | ||
'arrays': 'always-multiline', // let [a,] = [1,] | ||
'exports': 'always-multiline', // export {a,} | ||
|
||
// Should only be enabled when linting ECMAScript 2017 (ES8) or higher | ||
'functions': 'ignore', // (function(a,){ })(b,) | ||
// Should only be enabled when linting ECMAScript 2017 (ES8) or higher | ||
'functions': 'ignore', // (function(a,){ })(b,) | ||
|
||
'imports': 'always-multiline', // import {a,} from "foo" | ||
'objects': 'always-multiline', // let {a,} = {a: 1} | ||
}], | ||
|
||
'imports': 'always-multiline', // import {a,} from "foo" | ||
'objects': 'always-multiline', // let {a,} = {a: 1} | ||
}], | ||
// Enforces at least one newline at the end of non-empty files | ||
'eol-last': ['error', 'always'], | ||
|
||
// Consistent indentation style | ||
'indent': [ | ||
'error', 2, { | ||
// Indent case clauses with 2 spaces with respect to switch statements | ||
SwitchCase: 1, | ||
}], | ||
|
||
// Consistent line endings independent of operating system, VCS, or editor used across your codebase (default: unix) | ||
'linebreak-style': ['error', 'unix'], | ||
|
||
// Enforce a maximum line length of 120 characters (instead of 80 from Standard) [See pull request #4] | ||
'max-len': ['error', 120], | ||
|
||
// Require constructor names to begin with a capital letter | ||
'new-cap': [ | ||
'error', { | ||
// Allows specified uppercase-started function names to be called without the new operator | ||
capIsNewExceptions: ['Polymer'], | ||
|
||
// Allows any uppercase-started function names that match the specified regex pattern to be called without the | ||
// new operator | ||
capIsNewExceptionPattern: '^(UdeS|Polymer)', | ||
}], | ||
// Disallow trailing spaces at the end of lines | ||
'no-trailing-spaces': 'error', | ||
|
||
// Disallow the use of console [See pull request #2] | ||
'no-console': 'warn', | ||
|
||
// Require JSDoc comments | ||
'require-jsdoc': [ | ||
'error', { | ||
// Requires JSDoc comments for the specified nodes | ||
'require': { | ||
// Class Foo | ||
'ClassDeclaration': true, | ||
|
||
// function foo() {} | ||
'FunctionDeclaration': true, | ||
|
||
// constructor() {} [See pull request #1] | ||
'MethodDefinition': false, | ||
}, | ||
}, | ||
], | ||
|
||
// Enforce valid JSDoc comments | ||
'valid-jsdoc': ['error', { | ||
// If and only if the function or method has a return statement [See pull request #1] | ||
requireReturn: false, | ||
}], | ||
}, | ||
// enforce consistent spacing inside braces | ||
'object-curly-spacing': ['error', 'always'], | ||
|
||
// Override from Google | ||
// https://github.com/google/eslint-config-google/blob/394bf3c9f858b83514fdcbf23d74492e253d611f/index.js#L269-L275 | ||
'require-jsdoc': 'off', | ||
|
||
// Variables that are accessed but not defined within the same file | ||
globals: { | ||
// UdeS components and global scoped variables | ||
UdeS: true, | ||
// Require or disallow semicolons instead of ASI | ||
'semi': ['error', 'always'], | ||
|
||
// UdeS components and global scoped variables | ||
Polymer: true, | ||
// Override from Google | ||
// https://github.com/google/eslint-config-google/blob/394bf3c9f858b83514fdcbf23d74492e253d611f/index.js#L65-L70 | ||
'valid-jsdoc': 'off', | ||
}, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module.exports = { | ||
// Extends the UdeS ESLint config | ||
extends: [ | ||
'./index.js', | ||
], | ||
|
||
// Supported JavaScript language options | ||
parserOptions: { | ||
// Enables ES8/ES2017 syntax | ||
ecmaVersion: 8, | ||
|
||
// Code is in ECMAScript modules (default: script) | ||
sourceType: 'module', | ||
}, | ||
|
||
// Defines global variables that are predefined | ||
env: { | ||
// Enable ES6 features (automatically sets the ecmaVersion parser option to 6) | ||
es6: true, | ||
|
||
// Node.js global variables and Node.js scoping | ||
node: true, | ||
}, | ||
}; |
Oops, something went wrong.