Skip to content

Commit

Permalink
Merge pull request #248 from EmmaRamirez/release/1.1.3
Browse files Browse the repository at this point in the history
Release/1.1.3
  • Loading branch information
EmmaRamirez authored Jun 1, 2020
2 parents ec7f9c1 + 9ddb74c commit 1b60613
Show file tree
Hide file tree
Showing 193 changed files with 20,951 additions and 15,057 deletions.
125 changes: 125 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
/*
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
https://github.com/typescript-eslint/tslint-to-eslint-config
It represents the closest reasonable ESLint configuration to this
project's original TSLint configuration.
We recommend eventually switching this configuration to extend from
the recommended rulesets in typescript-eslint.
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
Happy linting! 💖
*/
module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"prettier",
"prettier/@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"@typescript-eslint/tslint"
],
"rules": {
// "@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
"accessibility": "explicit"
}
],
"@typescript-eslint/indent": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/quotes": [
"warn",
"single"
],
"@typescript-eslint/semi": [
"error",
"always"
],
"@typescript-eslint/type-annotation-spacing": "off",
"brace-style": [
"error",
"1tbs"
],
"camelcase": "error",
"constructor-super": "error",
"default-case": "error",
"eqeqeq": [
"error",
"smart"
],
"id-blacklist": [
"error",
"any",
"Number",
"number",
"String",
"string",
"Boolean",
"boolean",
"Undefined",
"undefined"
],
"id-match": "error",
// "import/no-default-export": "error",
"import/order": "off",
"no-caller": "error",
"no-eval": "error",
"no-new-wrappers": "error",
"no-redeclare": "error",
"no-trailing-spaces": "error",
"no-underscore-dangle": "error",
"no-unsafe-finally": "error",
"no-var": "error",
"prefer-const": "error",
"prefer-template": "error",
"@typescript-eslint/tslint/config": [
"error",
{
"rules": {
"insecure-random": true,
"mocha-avoid-only": true,
"no-document-domain": true,
"no-document-write": true,
"no-duplicate-case": true,
"no-empty-interfaces": true,
"react-a11y-anchors": true,
"react-a11y-aria-unsupported-elements": true,
"react-a11y-event-has-role": true,
"react-a11y-img-has-alt": true,
"react-a11y-lang": true,
"react-a11y-tabindex-no-positive": true,
"react-this-binding-issue": [
true,
{
"allow-anonymous-listeners": true
}
],
"valid-typeof": true,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-module"
]
}
}
]
}
};
21 changes: 11 additions & 10 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"parser": "typescript",
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all",
"semi": true,
"jsx-bracket-same-line": true,
"requirePragma": false,
"tabWidth": 4
}
{
"parser": "typescript",
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all",
"semi": true,
"requirePragma": false,
"tabWidth": 4,
"jsxBracketSameLine": true,
"arrowParens": "always"
}
15 changes: 14 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
https://github.com/typescript-eslint/tslint-to-eslint-config

It represents the closest reasonable ESLint configuration to this
project's original TSLint configuration.

We recommend eventually switching this configuration to extend from
the recommended rulesets in typescript-eslint.
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md

Happy linting! 💖
*/
{
"typescript.tsdk": "node_modules/typescript/lib"
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is a beta. Expect everything to break. Save backups if you value them.

## A Preview

![alt](./src/assets/media-four.png) ![alt](./src/assets/media-three.png)
![alt](./src/assets/media-five.png)

## Running Locally

Expand Down Expand Up @@ -43,4 +43,4 @@ If you have ideas for features of fixes, please tell me! I want to make this app

## Legal

I don't own Pokemon or any of the images except those of the app itself. All rights belong to their respective parties, including The Pokemon Company International and Nintendo. This application itself independent of copyrighted content is licensed under MIT.
I don't own Pokemon or any of the images except those of the app itself. All rights belong to their respective parties, including The Pokemon Company International and Nintendo. This application itself independent of copyrighted content is licensed under MIT.
22 changes: 15 additions & 7 deletions imageCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import * as chalk from 'chalk';
import { listOfPokemon } from './src/utils/listOfPokemon';

const targetFile = `./images.md`;
const buildFile:string[] = [];
const alphabet:string[] = [];
const buildFile: string[] = [];
const alphabet: string[] = [];
let exists = 0;

const normalize = (str: string) => str.toLowerCase().replace(/\s/g, '-');
const toPercentage = (num, den) => `${ ((num / den) * 100).toFixed(0) }%`;
const toPercentage = (num, den) => `${((num / den) * 100).toFixed(0)}%`;

function missingByGeneration (list) {
function missingByGeneration(list) {
const generationPoints = [
{ start: 0, end: 151 },
{ start: 151, end: 251 },
Expand All @@ -27,15 +27,19 @@ function missingByGeneration (list) {
const generationList = list.slice(point.start, point.end);
const total = point.end - point.start;
let generationTotal = 0;
const generationMissing:string[] = [];
const generationMissing: string[] = [];
for (const pokemon of generationList) {
if (fs.existsSync(`src/img/${normalize(pokemon)}.jpg`)) {
generationTotal += 1;
} else {
generationMissing.push(pokemon);
}
}
return `${(chalk as any).blue(`[Gen ${idx + 1}]`)}: ${(chalk as any).yellow(`${generationTotal}/${total}`)} ${(chalk as any).red(toPercentage(generationTotal, total)) }, missing: ${generationMissing.length === 0 ? 'none' : generationMissing.join(', ')}\n`;
return `${(chalk as any).blue(`[Gen ${idx + 1}]`)}: ${(chalk as any).yellow(
`${generationTotal}/${total}`,
)} ${(chalk as any).red(toPercentage(generationTotal, total))}, missing: ${
generationMissing.length === 0 ? 'none' : generationMissing.join(', ')
}\n`;
});

console.log(resultMap.join('\n'));
Expand All @@ -58,7 +62,11 @@ for (const pokemon of pokemonList) {

fs.writeFile(targetFile, buildFile.join('\n'), (err) => {
if (err) throw new Error('Failed to write file.');
console.log(`Wrote ${targetFile} file with ${exists}/${listOfPokemon.length} ${(chalk as any).green(toPercentage(exists, listOfPokemon.length))} entries.`);
console.log(
`Wrote ${targetFile} file with ${exists}/${listOfPokemon.length} ${(chalk as any).green(
toPercentage(exists, listOfPokemon.length),
)} entries.`,
);
});

missingByGeneration(listOfPokemon);
15 changes: 8 additions & 7 deletions massRename.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,31 @@ console.log(`
Press Ctrl + C to exit.
`);


const onFileReadFunction = (filepath):string => {
const onFileReadFunction = (filepath): string => {
return `${filepath}-scarf.png`;
};

const targetDir = process.argv[2] ? process.argv[2] : './src/assets/icons/scarf/';
const __onFileRead__ = process.argv[3] ? process.argv[3] : onFileReadFunction;

function readFiles (dirname: string, onFileRead: any = __onFileRead__) {
function readFiles(dirname: string, onFileRead: any = __onFileRead__) {
fs.readdir(dirname, (err, filenames) => {
if (err) throw err;
filenames.forEach(filename => {
filenames.forEach((filename) => {
const __path__ = dirname + filename;
fs.readFile(__path__, 'utf-8', (err, _) => {
if (err) throw err;
const pathStart = filename.split('.')[0];
if (pathStart === '') throw err;
fs.rename(__path__, onFileReadFunction(dirname + pathStart), err => {
fs.rename(__path__, onFileReadFunction(dirname + pathStart), (err) => {
if (err) throw err;
console.log(`Renamed ${filename} to ${onFileReadFunction(dirname + pathStart)}`);
console.log(
`Renamed ${filename} to ${onFileReadFunction(dirname + pathStart)}`,
);
});
});
});
});
}

setTimeout(() => readFiles(targetDir), 3000);
setTimeout(() => readFiles(targetDir), 3000);
Loading

0 comments on commit 1b60613

Please sign in to comment.