-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ESLint with minimal config (#2831)
- Loading branch information
1 parent
7cd9e79
commit 772d42b
Showing
38 changed files
with
979 additions
and
67 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,122 @@ | ||
/** @type {import('eslint').Linter.Config} */ | ||
module.exports = { | ||
extends: 'eslint:recommended', | ||
rules: { | ||
// I turned this rule off because we use `hasOwnProperty` in a lot of places | ||
// TODO: Think about re-enabling this rule | ||
'no-prototype-builtins': 'off', | ||
// TODO: Think about re-enabling this rule | ||
'no-cond-assign': 'off', | ||
// TODO: Think about re-enabling this rule | ||
'no-inner-declarations': 'off', | ||
// TODO: Think about re-enabling this rule | ||
'no-sparse-arrays': 'off', | ||
|
||
// turning off some regex rules | ||
// these are supposed to protect against accidental use but we need those quite often | ||
'no-control-regex': 'off', | ||
'no-empty-character-class': 'off', | ||
'no-useless-escape': 'off' | ||
}, | ||
ignorePatterns: [ | ||
'*.min.js', | ||
'vendor/', | ||
'utopia.js', | ||
'docs/', | ||
'components.js', | ||
'prism.js', | ||
'node_modules' | ||
], | ||
|
||
overrides: [ | ||
{ | ||
// Languages and plugins | ||
files: [ | ||
'components/*.js', | ||
'plugins/*/prism-*.js' | ||
], | ||
excludedFiles: 'components/index.js', | ||
env: { | ||
browser: true, | ||
node: true, | ||
worker: true | ||
}, | ||
globals: { | ||
'Prism': true | ||
} | ||
}, | ||
{ | ||
// `loadLanguages` function for Node.js | ||
files: 'components/index.js', | ||
env: { | ||
es6: true, | ||
node: true | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 6 | ||
}, | ||
globals: { | ||
'Prism': true | ||
} | ||
}, | ||
{ | ||
// Gulp and Danger | ||
files: 'dependencies.js', | ||
env: { | ||
browser: true, | ||
node: true | ||
} | ||
}, | ||
{ | ||
// The scripts that run on our website | ||
files: 'assets/*.js', | ||
env: { | ||
browser: true | ||
}, | ||
globals: { | ||
'components': true, | ||
'getLoader': true, | ||
'PrefixFree': true, | ||
'Prism': true, | ||
'Promise': true, | ||
'saveAs': true, | ||
'$': true, | ||
'$$': true, | ||
'$u': true | ||
} | ||
}, | ||
{ | ||
// Test files | ||
files: 'tests/**', | ||
env: { | ||
es6: true, | ||
mocha: true, | ||
node: true | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2018 | ||
} | ||
}, | ||
{ | ||
// Gulp and Danger | ||
files: [ | ||
'gulpfile.js/**', | ||
'dangerfile.js' | ||
], | ||
env: { | ||
es6: true, | ||
node: true | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2018 | ||
} | ||
}, | ||
{ | ||
// This file | ||
files: '.eslintrc.js', | ||
env: { | ||
node: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ gulpfile.js | |
.editorconfig | ||
.gitattributes | ||
.travis.yml | ||
.eslintrc.js |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -151,7 +151,7 @@ | |
} | ||
} | ||
return stack.length === 0; | ||
}; | ||
} | ||
|
||
/** | ||
* @param {string | Token | (string | Token)[]} token | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.