Skip to content

Commit

Permalink
3.10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ftzi committed Dec 20, 2023
1 parent 4410d6c commit 2a8d8de
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
> Changes to the `js` flavor are also applied to all the other flavors.
> Changes to the `ts` flavor are also applied to `react` and `react-native` flavors.
## 3.10.0~2
## 3.10.0~3

- Improved the bin. Now the dependency is added with the command and we are using a lighter package for the CLI parsing.

Expand Down
9 changes: 4 additions & 5 deletions bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ const flavors = files.map((s) => s.replace('.eslintrc.js', ''));
const flavorsString = flavors.join(', ');

const addDependency = (packageName, version, dev = false) => {
const packageJsonPath = path.join(__dirname, 'package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
const packageJsonPath = 'package.json';
const packageJsonObj = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));

const depKey = dev ? 'devDependencies' : 'dependencies';

packageJson[depKey] = packageJson[depKey] || {};
packageJson[depKey][packageName] = version;
(packageJsonObj[depKey] ??= {})[packageName] = version;

fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJsonObj, null, 2));
};

const setupEslint = (flavor, { force, js }) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-gev",
"version": "3.10.2",
"version": "3.10.3",
"description": "Common ESLint configs for my JS/TS and React/RN projects",
"main": "index.js",
"bin": "bin.js",
Expand Down

0 comments on commit 2a8d8de

Please sign in to comment.