Skip to content

Commit

Permalink
feat: use package.json prettier config way
Browse files Browse the repository at this point in the history
  • Loading branch information
john-d-pelingo committed Dec 1, 2020
1 parent 8fde366 commit 9af5612
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .commitlintrc.js
Expand Up @@ -3,4 +3,4 @@ module.exports = {
rules: {
'header-max-length': [0, 'always', 120],
},
};
}
1 change: 0 additions & 1 deletion .prettierrc.js

This file was deleted.

3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -14,7 +14,10 @@
"engines": {
"node": ">=14"
},
"prettier": "@jdp-dev/prettier-config",
"scripts": {
"format": "prettier --write './**/*.{js,ts,json,yml,yaml,css,html}'",
"prerelease": "yarn test",
"release": "standard-version",
"test": "yarn workspaces run test"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config/.eslintrc.js
Expand Up @@ -50,6 +50,6 @@ const config = {
version: 'detect',
},
},
};
}

module.exports = config;
module.exports = config
8 changes: 4 additions & 4 deletions packages/eslint-config/__tests__/index.js
@@ -1,6 +1,6 @@
const test = require('tape');
const test = require('tape')

test('entry point parses', (t) => {
t.doesNotThrow(() => require('..'), 'index does not throw');
t.end();
});
t.doesNotThrow(() => require('..'), 'index does not throw')
t.end()
})
16 changes: 8 additions & 8 deletions packages/eslint-config/__tests__/validate-config.js
@@ -1,20 +1,20 @@
const eslint = require('eslint');
const test = require('tape');
const eslint = require('eslint')
const test = require('tape')

test('load config in eslint to validate all rule syntax is correct', (t) => {
const cli = new eslint.CLIEngine({
useEslintrc: false,
configFile: 'index.js',
});
})

const code = `
const Hello = ({ name }: { name: string }) => {
return <div>Hello, {name}!</div>
}
`;
`

const result = cli.executeOnText(code);
const result = cli.executeOnText(code)

t.equal(result.errorCount, 0);
t.end();
});
t.equal(result.errorCount, 0)
t.end()
})
2 changes: 1 addition & 1 deletion packages/eslint-config/index.js
@@ -1 +1 @@
module.exports = require('./.eslintrc.js');
module.exports = require('./.eslintrc.js')
8 changes: 4 additions & 4 deletions packages/prettier-config/__tests__/index.js
@@ -1,6 +1,6 @@
const test = require('tape');
const test = require('tape')

test('entry point parses', (t) => {
t.doesNotThrow(() => require('../index.json'), 'index does not throw');
t.end();
});
t.doesNotThrow(() => require('../index.json'), 'index does not throw')
t.end()
})

0 comments on commit 9af5612

Please sign in to comment.