Skip to content

Commit

Permalink
💅 integrate prettier and eslint (#1240)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-b-r-o-w-n authored Jan 17, 2019
1 parent 877843d commit d71c03c
Show file tree
Hide file tree
Showing 672 changed files with 60,365 additions and 73,910 deletions.
4 changes: 1 addition & 3 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
],
"@babel/preset-typescript"
],
"ignore": [
"**/*.d.ts"
],
"ignore": ["**/*.d.ts"],
"sourceMaps": "inline",
"plugins": [
"@babel/plugin-proposal-class-properties",
Expand Down
62 changes: 62 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:typescript/recommended',
'plugin:prettier/recommended',
],
plugins: ['import', 'notice'],
env: {
browser: true,
es6: true,
node: true,
},
rules: {
// eslint rules
'no-dupe-class-members': 'off',
'no-undef': 'off', // ts compiler catches this
'prefer-const': 'error',

// plugin: import
'import/first': 'error',
'import/order': ['error', { 'newlines-between': 'always' }],

// plugin: notice
'notice/notice': [
'error',
{
mustMatch: 'Copyright \\(c\\) Microsoft',
templateFile: require.resolve('./copyright.js'),
messages: {
whenFailedToMatch: 'Missing copyright header.',
},
},
],

// plugin: typescript
'typescript/explicit-function-return-type': 'off',
'typescript/explicit-member-accessibility': 'off',
'typescript/indent': 'off',
'typescript/no-empty-interface': 'warn',
'typescript/no-object-literal-type-assertion': 'off',
'typescript/no-parameter-properties': 'off',
'typescript/no-use-before-define': [
'error',
{ functions: false, classes: false },
],
},
overrides: [
{
files: ['**/*.+(js|jsx)'],
parser: 'babel-eslint',
},
{
files: ['**/*.+(test|spec).+(js|jsx|ts|tsx)'],
env: {
jest: true,
},
rules: {
'typescript/class-name-casing': 'off',
},
},
],
};
26 changes: 26 additions & 0 deletions .eslintrc.react.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
extends: ['./.eslintrc.js', 'plugin:react/recommended'],
settings: {
react: {
version: 'detect',
},
},
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
rules: {
'react/no-deprecated': 'warn',
},
overrides: [
{
files: ['**/*.+(test|spec).+(js|jsx|ts|tsx)'],
rules: {
'react/display-name': 'off',
},
},
],
};
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"parser": "typescript",
"trailingComma": "es5",
"singleQuote": true
}
32 changes: 32 additions & 0 deletions copyright.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Bot Framework: http://botframework.com
//
// Bot Framework Emulator Github:
// https://github.com/Microsoft/BotFramwork-Emulator
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
Loading

0 comments on commit d71c03c

Please sign in to comment.