Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2 #9

Merged
merged 9 commits into from
May 13, 2024
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# [2.0.0-next.1](https://github.com/boehringer-ingelheim/prettier-config/compare/v1.0.0...v2.0.0-next.1) (2024-05-09)


### Features

* **single-quote:** adjust single-quote option to true ([851cb09](https://github.com/boehringer-ingelheim/prettier-config/commit/851cb094b6f2879c929629fe64c8237fadc7e67c))


### BREAKING CHANGES

* **single-quote:** adjust single-quote option to true

# 1.0.0 (2022-12-01)


Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/** @type {import('prettier').Config} */
module.exports = {
printWidth: 120,
singleQuote: true,
};
32 changes: 26 additions & 6 deletions index.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
const test = require("node:test");
const assert = require("node:assert/strict");
const configFile = require("./index");
const test = require('node:test');
const assert = require('node:assert/strict');
const configFile = require('./index');
const prettier = require('prettier');

test("Prettier Configuration File", () => {
assert.ok(configFile, "is valid module export");
assert.ok(typeof configFile === "object", "is type of object");
test('Prettier Configuration File', () => {
assert.ok(configFile, 'is valid module export');
assert.ok(typeof configFile === 'object', 'is type of object');
});

test('Line length', async () => {
const candidate1 = "console.log('Test');\n";
assert.ok(await prettier.check(candidate1, { ...configFile, filepath: './index.js' }));

const candidate2 = `console.log('${'a'.repeat(104)}');\n`;
assert.ok(await prettier.check(candidate2, { ...configFile, filepath: './index.js' }));

const candidate3 = `console.log('${'a'.repeat(105)}');\n`;
assert.strictEqual(await prettier.check(candidate3, { ...configFile, filepath: './index.js' }), false);
});

test('Single quotes', async () => {
const candidate1 = "console.log('Test');\n";
assert.ok(await prettier.check(candidate1, { ...configFile, filepath: './index.js' }));

const candidate2 = 'console.log("Test");\n';
assert.strictEqual(await prettier.check(candidate2, { ...configFile, filepath: './index.js' }), false);
});
Loading