-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Lint entire codebase #4156
Closed
Closed
Lint entire codebase #4156
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const { composePlugins, withNx } = require('@nrwl/webpack') | ||
const webpack = require('webpack') | ||
const TerserPlugin = require("terser-webpack-plugin") | ||
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin") | ||
const TerserPlugin = require('terser-webpack-plugin') | ||
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin') | ||
|
||
// Nx plugins for webpack. | ||
module.exports = composePlugins(withNx(), (config) => { | ||
|
@@ -10,25 +10,24 @@ module.exports = composePlugins(withNx(), (config) => { | |
// add fallback for node modules | ||
config.resolve.fallback = { | ||
...config.resolve.fallback, | ||
"crypto": require.resolve("crypto-browserify"), | ||
"stream": require.resolve("stream-browserify"), | ||
"path": require.resolve("path-browserify"), | ||
"http": require.resolve("stream-http"), | ||
"https": require.resolve("https-browserify"), | ||
"constants": require.resolve("constants-browserify"), | ||
"os": false, //require.resolve("os-browserify/browser"), | ||
"timers": false, // require.resolve("timers-browserify"), | ||
"zlib": require.resolve("browserify-zlib"), | ||
"fs": false, | ||
"module": false, | ||
"tls": false, | ||
"net": false, | ||
"readline": false, | ||
"child_process": false, | ||
"buffer": require.resolve("buffer/"), | ||
"vm": require.resolve('vm-browserify'), | ||
crypto: require.resolve('crypto-browserify'), | ||
stream: require.resolve('stream-browserify'), | ||
path: require.resolve('path-browserify'), | ||
http: require.resolve('stream-http'), | ||
https: require.resolve('https-browserify'), | ||
constants: require.resolve('constants-browserify'), | ||
os: false, //require.resolve("os-browserify/browser"), | ||
timers: false, // require.resolve("timers-browserify"), | ||
zlib: require.resolve('browserify-zlib'), | ||
fs: false, | ||
module: false, | ||
tls: false, | ||
net: false, | ||
readline: false, | ||
child_process: false, | ||
buffer: require.resolve('buffer/'), | ||
vm: require.resolve('vm-browserify'), | ||
} | ||
|
||
|
||
// add externals | ||
config.externals = { | ||
|
@@ -58,13 +57,12 @@ module.exports = composePlugins(withNx(), (config) => { | |
// souce-map loader | ||
config.module.rules.push({ | ||
test: /\.js$/, | ||
use: ["source-map-loader"], | ||
enforce: "pre" | ||
use: ['source-map-loader'], | ||
enforce: 'pre', | ||
}) | ||
|
||
config.ignoreWarnings = [/Failed to parse source map/] // ignore source-map-loader warnings | ||
|
||
|
||
// set minimizer | ||
config.optimization.minimizer = [ | ||
new TerserPlugin({ | ||
|
@@ -80,13 +78,13 @@ module.exports = composePlugins(withNx(), (config) => { | |
extractComments: false, | ||
}), | ||
new CssMinimizerPlugin(), | ||
]; | ||
] | ||
|
||
config.watchOptions = { | ||
ignored: /node_modules/ | ||
ignored: /node_modules/, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
} | ||
|
||
config.experiments.syncWebAssembly = true | ||
|
||
return config; | ||
}); | ||
return config | ||
}) |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export const environment = { | ||
production: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
export const environment = { | ||
production: false | ||
}; | ||
} |
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 |
---|---|---|
@@ -1,35 +1,35 @@ | ||
import { VariableDeclaration } from "solidity-ast"; | ||
import { VariableDeclaration } from "solidity-ast" | ||
|
||
export function trim(text: string) { | ||
if (typeof text === 'string') { | ||
return text.trim(); | ||
return text.trim() | ||
} | ||
} | ||
|
||
export function joinLines(text?: string) { | ||
if (typeof text === 'string') { | ||
return text.replace(/\n+/g, ' '); | ||
return text.replace(/\n+/g, ' ') | ||
} | ||
} | ||
|
||
/** | ||
* Format a variable as its type followed by its name, if available. | ||
*/ | ||
export function formatVariable(v: VariableDeclaration): string { | ||
return [v.typeName?.typeDescriptions.typeString].concat(v.name || []).join(' '); | ||
return [v.typeName?.typeDescriptions.typeString].concat(v.name || []).join(' ') | ||
} | ||
|
||
export const eq = (a: unknown, b: unknown) => a === b; | ||
export const eq = (a: unknown, b: unknown) => a === b | ||
|
||
export const slug = (str) => { | ||
if (str === undefined) { | ||
throw new Error('Missing argument'); | ||
throw new Error('Missing argument') | ||
} | ||
return str.replace(/\W/g, '-'); | ||
return str.replace(/\W/g, '-') | ||
} | ||
|
||
export const names = params => params.map(p => p.name).join(', '); | ||
export const names = params => params.map(p => p.name).join(', ') | ||
|
||
export const typedParams = params => { | ||
return params?.map(p => `${p.type}${p.indexed ? ' indexed' : ''}${p.name ? ' ' + p.name : ''}`).join(', '); | ||
}; | ||
return params?.map(p => `${p.type}${p.indexed ? ' indexed' : ''}${p.name ? ' ' + p.name : ''}`).join(', ') | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we should use comma for last item in JSON . See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Trailing_commas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a json file. its a js file