-
-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependencies and fux ESLint issues
- Loading branch information
Showing
14 changed files
with
747 additions
and
1,081 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
module.exports = { | ||
plugins: ['prettier'], | ||
extends: ['next/core-web-vitals'], | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react-hooks/recommended', | ||
'plugin:@next/next/recommended', | ||
], | ||
ignorePatterns: ['dist', '.eslintrc.js'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['react-refresh'], | ||
rules: { | ||
'no-console': 'error', | ||
'prettier/prettier': 'warn', | ||
'react-hooks/exhaustive-deps': 'off', | ||
'react/display-name': 'off', | ||
'import/no-anonymous-default-export': 'off', | ||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], | ||
}, | ||
}; |
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
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
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,45 @@ | ||
import Themes from '../../../themes.json'; | ||
|
||
export const theme = async ( | ||
args: string[], | ||
callback?: (value: string) => string, | ||
): Promise<string> => { | ||
if (args.length === 0) { | ||
return `Usage: theme [arg] | ||
const help = `Usage: theme [arg] | ||
Args: | ||
- ls: list all themes | ||
- set: set a theme | ||
- random: set a random theme | ||
Example: | ||
Example: | ||
theme ls # to list all themes | ||
theme set Gruvbox # to set a theme`; | ||
|
||
export const theme = async ( | ||
args: string[], | ||
callback?: (value: string) => string, | ||
): Promise<string> => { | ||
if (args.length === 0) { | ||
return help; | ||
} | ||
|
||
switch (args[0]) { | ||
case 'ls': | ||
case 'ls': { | ||
let result = Themes.map((theme) => theme.name.toLowerCase()).join(', '); | ||
result += '\n\n'; | ||
result += `You can preview all these themes <a href="https://github.com/m4tt72/terminal/tree/master/docs/themes">in the docs</a>`; | ||
|
||
return result; | ||
case 'set': | ||
} | ||
|
||
case 'set': { | ||
const selectedTheme = args[1]; | ||
|
||
return callback(selectedTheme); | ||
case 'random': | ||
} | ||
|
||
case 'random': { | ||
const randomTheme = Themes[Math.floor(Math.random() * Themes.length)]; | ||
|
||
return callback(randomTheme.name.toLowerCase()); | ||
} | ||
|
||
default: | ||
return help; | ||
} | ||
}; |
Oops, something went wrong.