-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add custom eslint rule for adding license-checks (#141)
* chore: add custom eslint rule for adding license-checks * move standard & prettier as plugin
- Loading branch information
1 parent
537bf19
commit df51d21
Showing
34 changed files
with
1,237 additions
and
1,451 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,14 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.{md,asciidoc}] | ||
trim_trailing_whitespace = false | ||
insert_final_newline = false |
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,6 @@ | ||
build | ||
docs | ||
coverage | ||
dist | ||
*.e2e-bundle.* | ||
test/e2e/sourcemap |
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,10 +1,35 @@ | ||
const { readFileSync } = require('fs') | ||
const { join } = require('path') | ||
/** | ||
* Helps with using custom eslint rules without creating and publishing as plugin | ||
*/ | ||
const rulesDirPlugin = require('eslint-plugin-rulesdir') | ||
rulesDirPlugin.RULES_DIR = join(__dirname, 'scripts/eslint-rules') | ||
|
||
const MIT_LICENSE = readFileSync('./LICENSE', 'utf-8') | ||
const LICENSE_HEADER = | ||
'/**\n' + | ||
MIT_LICENSE.split('\n') | ||
.map(line => ` * ${line}`) | ||
.join('\n') + | ||
'\n */' | ||
|
||
module.exports = { | ||
"env": { | ||
"es6": true | ||
}, | ||
"rules": { | ||
"max-len": ["error", { "code": 100 }], | ||
'no-unused-vars': 'error', | ||
'space-before-function-paren': 'error' | ||
} | ||
} | ||
env: { | ||
es6: true, | ||
browser: true | ||
}, | ||
parser: 'babel-eslint', | ||
plugins: ['prettier', 'standard', 'rulesdir'], | ||
rules: { | ||
'max-len': ['error', { code: 100, ignoreComments: true }], | ||
'no-unused-vars': 'error', | ||
'space-before-function-paren': 'error', | ||
'rulesdir/require-license-header': [ | ||
'error', | ||
{ | ||
license: LICENSE_HEADER | ||
} | ||
] | ||
} | ||
} |
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
Oops, something went wrong.