refactor: add eslint header plugin with copywright text

Signed-off-by: Chapman Pendery <cpendery@vt.edu>
This commit is contained in:
Chapman Pendery
2023-10-08 01:45:20 -07:00
parent af29b9ce6e
commit ba48c36ee8
22 changed files with 83 additions and 3 deletions
+5 -2
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
module.exports = {
env: {
es2021: true,
@@ -20,8 +23,8 @@ module.exports = {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["@typescript-eslint", "react"],
rules: {},
plugins: ["@typescript-eslint", "react", "header"],
rules: { "header/header": [2, "line", [" Copyright (c) Microsoft Corporation.", " Licensed under the MIT License."]] },
settings: {
react: {
version: "detect",
+3
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
// [...]
+17
View File
@@ -28,6 +28,7 @@
"@withfig/autocomplete-types": "^1.28.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-react": "^7.33.2",
"jest": "^29.7.0",
"prettier": "3.0.3",
@@ -3314,6 +3315,15 @@
"eslint": ">=7.0.0"
}
},
"node_modules/eslint-plugin-header": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz",
"integrity": "sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==",
"dev": true,
"peerDependencies": {
"eslint": ">=7.7.0"
}
},
"node_modules/eslint-plugin-react": {
"version": "7.33.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.2.tgz",
@@ -10513,6 +10523,13 @@
"dev": true,
"requires": {}
},
"eslint-plugin-header": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz",
"integrity": "sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==",
"dev": true,
"requires": {}
},
"eslint-plugin-react": {
"version": "7.33.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.2.tgz",
+2 -1
View File
@@ -48,10 +48,11 @@
"@withfig/autocomplete-types": "^1.28.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-react": "^7.33.2",
"jest": "^29.7.0",
"prettier": "3.0.3",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
}
}
}
+3
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { Command } from "commander";
import { supportedShells } from "../utils/bindings.js";
import { render } from "../ui/ui-bind.js";
+3
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { render } from "../ui/ui-root.js";
import { executeShellCommandTTY } from "../runtime/utils.js";
import { saveCommand, loadCommand } from "../utils/cache.js";
+5
View File
@@ -1,5 +1,10 @@
#!/usr/bin/env node
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/* eslint-disable header/header */
import { Command } from "commander";
import bind from "./commands/bind.js";
+3
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { runTemplates } from "./template.js";
import { buildExecuteShellCommand } from "./utils.js";
+3
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
export type Suggestion = {
name: string;
allNames: string[];
+3
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
export type CommandToken = {
token: string;
complete: boolean;
+3
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import speclist, {
diffVersionedCompletions as versionedSpeclist,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
+3
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { CommandToken } from "./parser.js";
import { runGenerator } from "./generator.js";
import { runTemplates } from "./template.js";
+3
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import fsAsync from "fs/promises";
import process from "node:process";
+3
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { exec, spawn } from "node:child_process";
type ExecuteShellCommandTTYResult = {
+3
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { parseCommand } from "../../runtime/parser.js";
const testData = [
+3
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { getSuggestions } from "../../runtime/runtime.js";
const testData = [
+3
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import React, { useState, useEffect } from "react";
import { useInput, Text } from "ink";
import chalk from "chalk";
+3
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import React, { useState, useCallback, useEffect } from "react";
import { Text, useInput, Box, measureElement, DOMElement } from "ink";
import wrapAnsi from "wrap-ansi";
+3
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import React, { useEffect, useState } from "react";
import { Box, Text, render as inkRender, useInput, useApp } from "ink";
import chalk from "chalk";
+3
View File
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import React, { useCallback, useEffect, useState } from "react";
import { Text, Box, render as inkRender, measureElement, DOMElement, useInput, useApp } from "ink";
import wrapAnsi from "wrap-ansi";

Some files were not shown because too many files have changed in this diff Show More