Skip to content

Update files to match new Prettier settings #15030

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 3 additions & 15 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript"
"plugin:import/typescript",
"prettier"
],
"rules": {
// Overriding ESLint rules with Typescript-specific ones
Expand Down Expand Up @@ -40,14 +41,7 @@
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "off",
// Overriding formatting rules to let Prettier handle them
"comma-dangle": "off",
"function-paren-newline": "off",
"implicit-arrow-linebreak": "off",
"indent": "off",
"max-len": "off",
"object-curly-newline": ["error", {"ImportDeclaration": {"consistent": true}}],
"operator-linebreak": "off",

// Other rules
"class-methods-use-this": ["error", {"exceptMethods": ["dispose"]}],
"func-names": "off",
Expand All @@ -63,12 +57,6 @@
"import/prefer-default-export": "off",
"linebreak-style": "off",
"no-await-in-loop": "off",
"no-confusing-arrow": [
"error",
{
"allowParens": true
}
],
"no-console": "off",
"no-control-regex": "off",
"no-extend-native": "off",
Expand Down
3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
printWidth: 120,
tabWidth: 4,
endOfLine: 'auto',
trailingComma: 'none',
trailingComma: 'all',
overrides: [
{
files: ['*.yml', '*.yaml'],
Expand Down
6 changes: 3 additions & 3 deletions build/webpack/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ exports.nodeModulesToExternalize = [
'diff-match-patch',
'sudo-prompt',
'node-stream-zip',
'xml2js'
'xml2js',
];
exports.nodeModulesToReplacePaths = [...exports.nodeModulesToExternalize];
function getDefaultPlugins(name) {
Expand All @@ -37,8 +37,8 @@ function getDefaultPlugins(name) {
reportFilename: `${name}.analyzer.html`,
generateStatsFile: true,
statsFilename: `${name}.stats.json`,
openAnalyzer: false // Open file manually if you want to see it :)
})
openAnalyzer: false, // Open file manually if you want to see it :)
}),
);
}
return plugins;
Expand Down
2 changes: 1 addition & 1 deletion build/webpack/plugins/less-plugin-base64.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Base64Visitor {
'data-uri',
[new Base64MimeTypeNode(), URLNode.value],
URLNode.index || 0,
URLNode.currentFileInfo
URLNode.currentFileInfo,
);
}
}
Expand Down
34 changes: 17 additions & 17 deletions build/webpack/webpack.extension.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,40 @@ const config = {
mode: 'production',
target: 'node',
entry: {
extension: './src/client/extension.ts'
extension: './src/client/extension.ts',
},
devtool: 'source-map',
node: {
__dirname: false
__dirname: false,
},
module: {
rules: [
{
test: /\.ts$/,
use: [
{
loader: path.join(__dirname, 'loaders', 'externalizeDependencies.js')
}
]
loader: path.join(__dirname, 'loaders', 'externalizeDependencies.js'),
},
],
},
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader'
}
]
loader: 'ts-loader',
},
],
},
{
test: /\.node$/,
use: [
{
loader: 'node-loader'
}
]
}
]
loader: 'node-loader',
},
],
},
],
},
externals: ['vscode', 'commonjs', ...existingModulesInOutDir],
plugins: [...common.getDefaultPlugins('extension')],
Expand All @@ -57,17 +57,17 @@ const config = {
// Pointing pdfkit to a dummy js file so webpack doesn't fall over.
// Since pdfkit has been externalized (it gets updated with the valid code by copying the pdfkit files
// into the right destination).
pdfkit: path.resolve(__dirname, 'pdfkit.js')
pdfkit: path.resolve(__dirname, 'pdfkit.js'),
},
extensions: ['.ts', '.js'],
plugins: [new tsconfig_paths_webpack_plugin.TsconfigPathsPlugin({ configFile: configFileName })]
plugins: [new tsconfig_paths_webpack_plugin.TsconfigPathsPlugin({ configFile: configFileName })],
},
output: {
filename: '[name].js',
path: path.resolve(constants.ExtensionRootDir, 'out', 'client'),
libraryTarget: 'commonjs2',
devtoolModuleFilenameTemplate: '../../[resource-path]'
}
devtoolModuleFilenameTemplate: '../../[resource-path]',
},
};
// tslint:disable-next-line:no-default-export
exports.default = config;
10 changes: 5 additions & 5 deletions build/webpack/webpack.extension.dependencies.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ const config = {
entry: entryItems,
devtool: 'source-map',
node: {
__dirname: false
__dirname: false,
},
module: {},
externals: ['vscode', 'commonjs'],
plugins: [
...common.getDefaultPlugins('dependencies'),
// vsls requires our package.json to be next to node_modules. It's how they
// 'find' the calling extension.
new copyWebpackPlugin([{ from: './package.json', to: '.' }])
new copyWebpackPlugin([{ from: './package.json', to: '.' }]),
],
resolve: {
extensions: ['.js']
extensions: ['.js'],
},
output: {
filename: '[name].js',
path: path.resolve(constants.ExtensionRootDir, 'out', 'client'),
libraryTarget: 'commonjs2',
devtoolModuleFilenameTemplate: '../../[resource-path]'
}
devtoolModuleFilenameTemplate: '../../[resource-path]',
},
};
// tslint:disable-next-line:no-default-export
exports.default = config;
Loading