Skip to content
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

No unused vars as errors #814

Merged
merged 4 commits into from
Aug 31, 2023
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/gorgeous-ducks-explode.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we merge this file like this. Will all subsequent changesets not trigger a "missing" changeset, and inadvertently result in missing changeset entries when we release?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. Let's keep an eye on it.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
8 changes: 1 addition & 7 deletions packages/apps/docs/src/scripts/checkForHeaders.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@ const removeCodeBlocks = (content) => {
return content.replace(codeBlockRegex, '');
};

const checkifImported = (file) => {
return importReadMes.find((item) => {
return file.includes(item.destination);
});
};

const checkForHeaders = async (filePath, links) => {
const checkForHeaders = async () => {
const paths = await globby([`${ROOT}/**/*.md`]);

paths.forEach((item) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/docs/src/scripts/importReadme.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const relinkLinkReferences = (refs, definitions, pages, root) => {
});
};

const relinkImageReferences = (refs, definitions, pages, root) => {
const relinkImageReferences = (refs, definitions) => {
refs.map((ref) => {
const definition = definitions.find((def) => def.label === ref.label);
if (!definition) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { getData } from './getData.mjs';
import path from 'path';

const omit = (obj, ...keysToOmit) =>
Object.keys(obj)
.filter((key) => !keysToOmit.includes(key))
.reduce((acc, key) => ({ ...acc, [key]: obj[key] }), {});

const isIndex = (filename) => {
return filename === 'index';
};
Expand Down Expand Up @@ -31,18 +36,17 @@ const IsMenuOpen = (pathname, itemRoot) =>
const isPathRoot = (pathname, itemRoot) => itemRoot === pathname;

const mapSubTree = (pathname, noChildren, isRoot) => (item) => {
const {
description,
subTitle,
layout,
navigation,
editLink,
order,
lastModifiedDate,
publishDate,
author,
...newItem
} = item;
const newItem = omit(item, [
'description',
'subTitle',
'layout',
'navigation',
'editLink',
'order',
'lastModifiedDate',
'publishDate',
'author',
]);

if (IsMenuOpen(pathname, newItem.root)) {
newItem.isMenuOpen = true;
Expand All @@ -56,9 +60,6 @@ const mapSubTree = (pathname, noChildren, isRoot) => (item) => {
newItem.isActive = false;
}

delete newItem.description;
delete newItem.subTitle;

// is the actual item active
if (!newItem.children || noChildren) newItem.children = [];
if (isRoot && !pathname.includes(newItem.root)) newItem.children = [];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { IBlock } from '../../../utils/hooks/use-parsed-blocks';
import { Box } from '../../box';
import { Text } from '../../text';

import { TimeTicker } from './../time-ticker';
import { Container, Content } from './styles';

import { RocketIcon, TimerIcon } from '@radix-ui/react-icons';
import { TimerIcon } from '@radix-ui/react-icons';
import React from 'react';

interface IChainBlockProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ async function doCrossChainTransfer(
to: IAccount,
amount: string,
): Promise<Record<string, ICommandResult>> {
const state = {};
return (
Promise.resolve(startInTheFirstChain(from, to, amount))
.then((command) => signWithChainweaver(command))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import { pollStatus, preflight, submit } from '../util/client';
import { asyncPipe, inspect } from '../util/fp-helpers';

// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-function-return-type
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
const getTransferCommand = ({
sender,
receiver,
Expand Down
10 changes: 0 additions & 10 deletions packages/libs/pactjs-generator/src/contract/parsing/lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,16 +271,6 @@ function getModuleAndMethods(contract, logger) {
return output;
}
exports.getModuleAndMethods = getModuleAndMethods;
var TYPED_TOKEN_MATCH = 'atom,colon,atom';
function lastThreeTokenTypedAtomMatch(tokens) {
return (
tokens
.map(function (t) {
return t === null || t === void 0 ? void 0 : t.type;
})
.join() === TYPED_TOKEN_MATCH
);
}
var getLexerOutput = function (contract, logger) {
if (logger === void 0) {
logger = function () {};
Expand Down
1 change: 1 addition & 0 deletions packages/tools/eslint-config/profile/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = {
],
rules: {
'@kadena-dev/no-eslint-disable': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'prettier/prettier': ['warn', prettierOptions],
'prefer-template': 'warn',
'import/newline-after-import': 'error',
Expand Down