Skip to content

Commit

Permalink
refactor: set up prettier VSCODE-339 (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
alenakhineika authored Sep 5, 2022
1 parent 6bf6b5f commit e2fb176
Show file tree
Hide file tree
Showing 181 changed files with 4,547 additions and 3,105 deletions.
10 changes: 6 additions & 4 deletions .depcheckrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
ignores:
- "vscode"
- "keytar"
- "@babel/core"
- "@mongodb-js/prettier-config-compass"
- "@types/jest"
- "eslint-config-mongodb-js"
- "keytar"
- "mocha-junit-reporter"
- "mocha-multi"
- "pre-commit"
- "webpack-cli"
- "vscode-languageserver-textdocument"
- "@babel/core"
- "vscode"
- "webpack-cli"
33 changes: 18 additions & 15 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
const typescriptEslintEslintPlugin = require('@typescript-eslint/eslint-plugin');

// Overrides do not work with extends.
const ruleOverridesForJs = Object.keys(typescriptEslintEslintPlugin.rules).reduce(
(overrides, rule) => ({ ...overrides, [`@typescript-eslint/${rule}`]: 0 }), {}
const ruleOverridesForJs = Object.keys(
typescriptEslintEslintPlugin.rules
).reduce(
(overrides, rule) => ({ ...overrides, [`@typescript-eslint/${rule}`]: 0 }),
{}
);

module.exports = {
Expand All @@ -11,15 +14,13 @@ module.exports = {
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
project: [
'./tsconfig.json'
]
project: ['./tsconfig.json'],
},
extends: [
'eslint-config-mongodb-js/react',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking'
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
rules: {
'chai-friendly/no-unused-expressions': 0,
Expand All @@ -36,7 +37,7 @@ module.exports = {
'@typescript-eslint/ban-types': 0,
'mocha/no-skipped-tests': 1,
'mocha/no-exclusive-tests': 2,
'semi': 0,
semi: 0,
'@typescript-eslint/semi': [2, 'always'],
'no-console': [1, { allow: ['warn', 'error', 'info'] }],
'no-shadow': 0,
Expand All @@ -54,13 +55,15 @@ module.exports = {
'@typescript-eslint/no-unsafe-assignment': 0,
'@typescript-eslint/no-unsafe-member-access': 0,
'@typescript-eslint/no-unsafe-call': 0,
'@typescript-eslint/no-unsafe-return': 0
'@typescript-eslint/no-unsafe-return': 0,
},
overrides: [{
files: ['**/*.js'],
rules: {
...ruleOverridesForJs,
semi: [2, 'always']
}
}]
overrides: [
{
files: ['**/*.js'],
rules: {
...ruleOverridesForJs,
semi: [2, 'always'],
},
},
],
};
14 changes: 14 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.github
.vscode
.vscode-test
dist
images
languages
node_modules
out
playgrounds
resources
snippets
syntaxes
CHANGELOG.md
README.md
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@mongodb-js/prettier-config-compass"
13 changes: 8 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ module.exports = {
roots: ['<rootDir>/src/test/suite/views/webview-app'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
'.+\\.(less|svg)$': 'jest-transform-stub'
'.+\\.(less|svg)$': 'jest-transform-stub',
},
reporters: [
'default',
['jest-junit', {
outputName: 'test-webview-results.xml'
}]
[
'jest-junit',
{
outputName: 'test-webview-results.xml',
},
],
],
testRegex: '(/test/suite/views/webview-app/.*|(\\.|/)(test|spec))\\.tsx?$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupFiles: ['<rootDir>/src/test/suite/views/webview-app/jest-setup.js']
setupFiles: ['<rootDir>/src/test/suite/views/webview-app/jest-setup.js'],
};
Loading

0 comments on commit e2fb176

Please sign in to comment.