Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃拝 integrate prettier and eslint #1240

Merged
merged 43 commits into from
Jan 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
cf8a1a8
introduce dependency, tslint additions
cwhitten Jan 8, 2019
925e933
Lockfile
cwhitten Jan 8, 2019
d34bd3c
Prettier savepoints
cwhitten Jan 12, 2019
9a28c6f
Prettier step 2
cwhitten Jan 15, 2019
47a7a60
add includes to each tsconfig
a-b-r-o-w-n Jan 15, 2019
087fc7d
add node-fetch dep to emulator core
a-b-r-o-w-n Jan 15, 2019
7670594
add prettier config
a-b-r-o-w-n Jan 15, 2019
b025ff4
add prettier to pre-commit hook
a-b-r-o-w-n Jan 15, 2019
e77903a
add lint script to all packages
a-b-r-o-w-n Jan 16, 2019
6897a0a
lint & prettify sdk-shared
a-b-r-o-w-n Jan 16, 2019
eb0982d
fix linting setup script
a-b-r-o-w-n Jan 16, 2019
fa3ef0e
fix lint script in package.jsons
a-b-r-o-w-n Jan 16, 2019
f32b1e1
fix lint setup script again
a-b-r-o-w-n Jan 16, 2019
a77194f
add instructions to lint setup script
a-b-r-o-w-n Jan 16, 2019
f95d559
lint & prettify sdk-main
a-b-r-o-w-n Jan 16, 2019
7ea39fc
add eslint config to lint setup
a-b-r-o-w-n Jan 16, 2019
9f8c342
lint & prettify ui-react
a-b-r-o-w-n Jan 16, 2019
97fa494
lint & prettify sdk-client
a-b-r-o-w-n Jan 16, 2019
7beb0b0
remove prettier-eslint dependency
a-b-r-o-w-n Jan 16, 2019
b3847fa
lint & prettify app-shared
a-b-r-o-w-n Jan 16, 2019
365b5b8
use ts compiler to check for unused variables
a-b-r-o-w-n Jan 16, 2019
19cd490
lint & prettify app main
a-b-r-o-w-n Jan 16, 2019
2c64141
lint & prettify app client
a-b-r-o-w-n Jan 16, 2019
3c04dab
apply new lint rules
a-b-r-o-w-n Jan 16, 2019
43c07d7
do not lint scss.d.ts files
a-b-r-o-w-n Jan 16, 2019
32a890e
fix conflicts from master
a-b-r-o-w-n Jan 17, 2019
d0be2df
lint & prettify luis client
a-b-r-o-w-n Jan 17, 2019
3ada833
enable parsing of jsx in js files
a-b-r-o-w-n Jan 17, 2019
8251875
lint & prettify debug extension
a-b-r-o-w-n Jan 17, 2019
24915b6
lint & prettify qna extension
a-b-r-o-w-n Jan 17, 2019
c5cc011
lint & prettify emulator core
a-b-r-o-w-n Jan 17, 2019
531011e
lint & prettify emulator cli
a-b-r-o-w-n Jan 17, 2019
5bddc35
add top level lint:fix script
a-b-r-o-w-n Jan 17, 2019
f6f5c6e
correctly represent return value
a-b-r-o-w-n Jan 17, 2019
2b1dc32
remove license from generated files
a-b-r-o-w-n Jan 17, 2019
7b7a388
revert converting to import
a-b-r-o-w-n Jan 17, 2019
6bc20f1
use defined class to export singleton
a-b-r-o-w-n Jan 17, 2019
1eb600a
get tests passing
a-b-r-o-w-n Jan 17, 2019
5dbb129
remove outdated comment
a-b-r-o-w-n Jan 17, 2019
d0bce8e
convert eslintrc to js modules
a-b-r-o-w-n Jan 17, 2019
a807ad3
fix merge conflicts
a-b-r-o-w-n Jan 17, 2019
5d9ee05
ignore scss typings
a-b-r-o-w-n Jan 17, 2019
fc0b947
do not bail when running lint scripts
a-b-r-o-w-n Jan 17, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 1 addition & 3 deletions .babelrc
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
@@ -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
@@ -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
@@ -0,0 +1,5 @@
{
"parser": "typescript",
"trailingComma": "es5",
"singleQuote": true
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can debate here on the prettier formatting options. https://prettier.io/docs/en/options.html

32 changes: 32 additions & 0 deletions copyright.js
@@ -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.
//