lint working for remix-url-resolver

pull/5/head
aniket-engg 4 years ago
parent 24d5fa2e0a
commit e209a82098
  1. 16
      libs/remix-url-resolver/.eslintrc
  2. 8
      libs/remix-url-resolver/src/resolve.ts
  3. 24
      libs/remix-url-resolver/tsconfig.json
  4. 16
      libs/remix-url-resolver/tsconfig.lib.json
  5. 18
      workspace.json

@ -0,0 +1,16 @@
{
"extends": "../../.eslintrc",
"rules": {
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/explicit-module-boundary-types": "off"
},
"env": {
"browser": true,
"amd": true,
"node": true,
"es6": true
},
"ignorePatterns": ["!**/*"]
}

@ -27,8 +27,9 @@ export class RemixURLResolver {
* @params filePath path of the file in github
*/
async handleGithubCall(root: string, filePath: string) {
//eslint-disable-next-line no-useless-catch
try {
let req: string = 'https://api.github.com/repos/' + root + '/contents/' + filePath
const req: string = 'https://api.github.com/repos/' + root + '/contents/' + filePath
const response: AxiosResponse = await axios.get(req)
return Buffer.from(response.data.content, 'base64').toString()
} catch(e) {
@ -41,6 +42,7 @@ export class RemixURLResolver {
* @params cleanURL
*/
async handleHttp(url: string, _: string) {
//eslint-disable-next-line no-useless-catch
try {
const response: AxiosResponse = await axios.get(url)
return response.data
@ -54,6 +56,7 @@ export class RemixURLResolver {
* @params cleanURL
*/
async handleHttps(url: string, _: string) {
//eslint-disable-next-line no-useless-catch
try {
const response: AxiosResponse = await axios.get(url)
return response.data
@ -71,6 +74,7 @@ export class RemixURLResolver {
async handleIPFS(url: string) {
// replace ipfs:// with /ipfs/
url = url.replace(/^ipfs:\/\/?/, 'ipfs/')
//eslint-disable-next-line no-useless-catch
try {
const req = 'https://gateway.ipfs.io/' + url
// If you don't find greeter.sol on ipfs gateway use local
@ -112,7 +116,7 @@ export class RemixURLResolver {
}
public async resolve(filePath: string, customHandlers?: Handler[]): Promise<Imported> {
var imported: Imported = this.previouslyHandled[filePath]
let imported: Imported = this.previouslyHandled[filePath]
if(imported) {
return imported
}

@ -1,21 +1,9 @@
{
"compileOnSave": false,
"include": ["./src"],
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./src",
"outDir": "./dist",
"sourceMap": true,
"declaration": true,
"types": ["node"],
"module": "commonjs",
"strict": true,
"noImplicitAny": false,
"strictPropertyInitialization": false,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": ["node_modules/@types"],
"lib": ["dom", "es2018"],
"paths": {
"remix-url-resolver": ["./"]
}
}
}
"esModuleInterop": true
},
"include": ["**/*.ts"]
}

@ -0,0 +1,16 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "../../dist/out-tsc",
"declaration": true,
"rootDir": "./src",
"types": ["node"]
},
"exclude": [
"**/*.spec.ts",
"tests/"
],
"include": ["**/*.ts"]
}

@ -354,23 +354,20 @@
"schematics": {},
"architect": {
"lint": {
"builder": "@nrwl/workspace:run-commands",
"builder": "@nrwl/linter:lint",
"options": {
"commands": [
{
"command": "./../../node_modules/.bin/npm-run-all lint"
}
"linter": "eslint",
"config": "libs/remix-url-resolver/.eslintrc",
"tsConfig": [
"libs/remix-url-resolver/tsconfig.lib.json"
],
"cwd": "libs/remix-url-resolver"
"exclude": ["**/node_modules/**", "libs/remix-url-resolver/tests/**/*"]
}
},
"test": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"commands": [
{
"command": "rm -rf ../../dist"
},
{
"command": "./../../node_modules/.bin/npm-run-all test"
}
@ -382,9 +379,6 @@
"builder": "@nrwl/workspace:run-commands",
"options": {
"commands": [
{
"command": "rm -rf ../../dist"
},
{
"command": "./../../node_modules/.bin/npm-run-all build"
}

Loading…
Cancel
Save