Skip to content

Commit

Permalink
Add a bunch of rules from github/github
Browse files Browse the repository at this point in the history
  • Loading branch information
koddsson committed Jul 15, 2021
1 parent 7285de2 commit 31668aa
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 2 deletions.
10 changes: 9 additions & 1 deletion lib/configs/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ module.exports = {
'github/unescaped-html-literal': 'error',
'github/no-useless-passive': 'error',
'github/require-passive-events': 'error',
'github/prefer-observers': 'error'
'github/prefer-observers': 'error',
'import/no-nodejs-modules': 'error',
'no-restricted-syntax': [
'error',
{
selector: "NewExpression[callee.name='URL'][arguments.length=1]",
message: 'Please pass in `window.location.origin` as the 2nd argument to `new URL()`'
}
]
}
}
14 changes: 13 additions & 1 deletion lib/configs/recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
env: {
es6: true
},
plugins: ['github', 'prettier', 'eslint-comments', 'import'],
plugins: ['github', 'prettier', 'eslint-comments', 'import', 'filenames', 'i18n-text'],
rules: {
'constructor-super': 'error',
'eslint-comments/disable-enable-pair': 'off',
Expand All @@ -18,16 +18,20 @@ module.exports = {
'eslint-comments/no-unused-disable': 'error',
'eslint-comments/no-unused-enable': 'error',
'eslint-comments/no-use': ['error', {allow: ['eslint', 'eslint-disable-next-line', 'eslint-env', 'globals']}],
'filenames/match-regex': ['error', '^[a-z0-9-]+(.d)?$'],
'func-style': ['error', 'declaration', {allowArrowFunctions: true}],
'github/array-foreach': 'error',
'github/no-implicit-buggy-globals': 'error',
'github/no-then': 'error',
'i18n-text/no-en': ['error'],
'import/default': 'error',
'import/export': 'error',
'import/extensions': 'error',
'import/first': 'error',
'import/named': 'error',
'import/namespace': 'error',
'import/no-absolute-path': 'error',
'import/no-amd': 'error',
'import/no-anonymous-default-export': [
'error',
{
Expand All @@ -39,12 +43,17 @@ module.exports = {
allowObject: true
}
],
'import/no-commonjs': 'error',
'import/no-deprecated': 'error',
'import/no-duplicates': 'error',
'import/no-dynamic-require': 'error',
'import/no-extraneous-dependencies': [0, {devDependencies: false}],
'import/no-mutable-exports': 'error',
'import/no-named-as-default': 'error',
'import/no-named-as-default-member': 'error',
'import/no-namespace': 'error',
'import/no-unresolved': 'error',
'import/no-webpack-loader-syntax': 'error',
'no-case-declarations': 'error',
'no-class-assign': 'error',
'no-compare-neg-zero': 'error',
Expand Down Expand Up @@ -80,6 +89,7 @@ module.exports = {
'no-regex-spaces': 'error',
'no-return-assign': 'error',
'no-self-assign': 'error',
'no-sequences': ['error'],
'no-shadow': 'error',
'no-sparse-arrays': 'error',
'no-this-before-super': 'error',
Expand All @@ -94,13 +104,15 @@ module.exports = {
'no-useless-escape': 'error',
'no-var': 'error',
'object-shorthand': ['error', 'always', {avoidQuotes: true}],
'one-var': ['error', 'never'],
'prefer-const': 'error',
'prefer-promise-reject-errors': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
'prettier/prettier': 'error',
'require-yield': 'error',
'sort-imports': 'error',
'use-isnan': 'error',
'valid-typeof': 'error',
camelcase: ['error', {properties: 'always'}],
Expand Down
81 changes: 81 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
"@typescript-eslint/parser": "^4.20.0",
"eslint-config-prettier": ">=8.0.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-i18n-text": "^1.0.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-prettier": "^3.3.1",
"eslint-rule-documentation": ">=1.0.0",
Expand Down

0 comments on commit 31668aa

Please sign in to comment.