diff --git a/deps.ts b/deps.ts index 118d3c0..6e37ab5 100644 --- a/deps.ts +++ b/deps.ts @@ -1,8 +1,8 @@ // to update use `udd deps.ts --test="deno test --allow-run ./mod_test.ts"` -export { green, bold } from "https://deno.land/std@0.75.0/fmt/colors.ts"; -export { fromFileUrl } from "https://deno.land/std@0.75.0/path/mod.ts"; +export { green, bold } from "https://deno.land/std@0.92.0/fmt/colors.ts"; +export { fromFileUrl } from "https://deno.land/std@0.92.0/path/mod.ts"; export { assert, assertEquals, -} from "https://deno.land/std@0.75.0/testing/asserts.ts"; +} from "https://deno.land/std@0.92.0/testing/asserts.ts"; diff --git a/mod.ts b/mod.ts index 98daca9..fd9caa2 100755 --- a/mod.ts +++ b/mod.ts @@ -1,16 +1,14 @@ -#!/usr/bin/env -S deno run --allow-run --allow-write - /** * @file Creates a .eslintrc.json config file for typescript-eslint with rules * @author David Else * @copyright 2020 David Else * @license gpl-3.0 * @version 0.9 - * tested with deno 1.5.0 + * tested with deno 1.8.3 */ - + import { assert, fromFileUrl } from "./deps.ts"; -import { rulesToAdd, checkedByTypeScript, userRulesToRemove } from "./rules.ts"; +import { checkedByTypeScript, rulesToAdd, userRulesToRemove } from "./rules.ts"; import { outputToConsole } from "./view.ts"; export interface EslintRules { @@ -42,7 +40,7 @@ const subprocess = Deno.run({ assert(subprocess.stdout); const commandOutput = await Deno.readAll(subprocess.stdout); const entireEslintConfig: EslintConfig = JSON.parse( - new TextDecoder().decode(commandOutput) + new TextDecoder().decode(commandOutput), ); /** @@ -60,7 +58,7 @@ export function rulesToRemove(key: string, val: string | number[]): boolean { !userRulesToRemove.includes(key) ); } - + /** * Filters a set of ESLint rules and returns an array with the new list and the removed rules * @@ -71,7 +69,7 @@ export function ruleFilter( esLintRules: EslintRules, rulesToRemoveCallback: { (key: string, val: string | number[]): boolean; - } + }, ): [EslintRules, string[]] { const removedRules: string[] = []; return [ @@ -84,7 +82,7 @@ export function ruleFilter( } removedRules.push(key); return false; - }) + }), ), removedRules, ]; @@ -92,7 +90,7 @@ export function ruleFilter( const [filteredEsLintRules, removedRuleNames] = ruleFilter( entireEslintConfig.rules, - rulesToRemove + rulesToRemove, ); /** @@ -122,7 +120,7 @@ const eslintrcJson = { if (import.meta.main) { Deno.writeTextFileSync( ".eslintrc.json", - JSON.stringify(eslintrcJson, null, 2) + JSON.stringify(eslintrcJson, null, 2), ); outputToConsole(removedRuleNames, Object.keys(rulesToAdd)); } diff --git a/package.json b/package.json index 1e422ac..0c351b0 100644 --- a/package.json +++ b/package.json @@ -21,4 +21,4 @@ "eslint-plugin-import": "2.22.0", "typescript": "^4.0.2" } -} \ No newline at end of file +} diff --git a/tsconfig.json b/tsconfig.json index df14122..c685c42 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,6 @@ { "compilerOptions": { /* Visit https://aka.ms/tsconfig.json to read more about this file */ - /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ "target": "ES2020" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, @@ -23,7 +22,6 @@ // "importHelpers": true, /* Import emit helpers from 'tslib'. */ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type-Checking Options */ "strict": true /* Enable all strict type-checking options. */, // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ @@ -33,13 +31,11 @@ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - /* Additional Checks */ // "noUnusedLocals": true, /* Report errors on unused locals. */ // "noUnusedParameters": true, /* Report errors on unused parameters. */ // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - /* Module Resolution Options */ // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ @@ -51,21 +47,22 @@ "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - /* Source Map Options */ // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - /* Experimental Options */ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - /* Advanced Options */ "skipLibCheck": true /* Skip type checking of declaration files. */, - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ + "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ }, - "include": ["./**/*"], - "exclude": ["node_modules"] + "include": [ + "./**/*" + ], + "exclude": [ + "node_modules" + ] }