Skip to content

Commit

Permalink
Removed prettier to make annotations accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
yousufkalim committed Jul 20, 2022
1 parent e830b81 commit 5157dec
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 55 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ All notable changes to this project will be documented in this file.
> - Internal
> - Unreleased
## v2.0.5

#### Enhancements

- Removed prettier in order to make annotations accurate

## v2.0.4

#### Enhancements
Expand Down
32 changes: 2 additions & 30 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-action",
"version": "2.0.4",
"version": "2.0.5",
"description": "Run ESLint on files changed in a pull request with inline error and warning annotations",
"author": "yousufkalim",
"license": "MIT",
Expand Down
11 changes: 2 additions & 9 deletions src/eslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { exec } from '@actions/exec';
import { disableAnnotations } from './annotations';
import getChangedFiles from './get-changed-files';
import { eslintRules } from './eslint-rules';
import { prettierConfig } from './prettier-config';

// user inputs interface
export interface Inputs {
Expand Down Expand Up @@ -74,16 +73,10 @@ export const runEslint = async (inputs: Inputs): Promise<void> => {
const execOptions = [path.resolve(inputs.binPath, 'eslint'), ...files, ...inputs.eslintArgs].filter(Boolean);

// Installing required libs
await exec('yarn add eslint eslint-config-airbnb prettier');
await exec('yarn add eslint eslint-config-airbnb');

// if auto-fix-before-test is true, then run prettier on the files
// if auto-fix-before-test is true, then run eslint with --fix
if (inputs.autofix) {
// Creating default .prettierrc file on user's project
fs.writeFileSync('.prettierrc', JSON.stringify(prettierConfig));

// Running prettier and eslint --fix on the files
await exec(`npx prettier --write ${files.join(' ')} --config ./.prettierrc`);

// Executing eslint
execOptions.splice(1, 0, '--fix');
await exec('node', execOptions);
Expand Down
12 changes: 0 additions & 12 deletions src/prettier-config.ts

This file was deleted.

0 comments on commit 5157dec

Please sign in to comment.