Skip to content

Commit

Permalink
chore(deps): bump prettier from 2.8.7 to 3.0.3 (#916)
Browse files Browse the repository at this point in the history
* chore(deps): bump prettier from 2.8.7 to 3.0.3

Bumps [prettier](https://github.com/prettier/prettier) from 2.8.7 to 3.0.3.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@2.8.7...3.0.3)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps): upgrade typescript

* chore(deps): upgrade sort-package-json

* chore(deps): upgrade eslint and related

* chore(deps): upgrade release-it

* chore(deps): upgrade markdown-lint

* chore(deps): upgrade prettier plugin, typescript-eslint

* style: prettier

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Beatty <[email protected]>
  • Loading branch information
dependabot[bot] and Max Beatty authored Oct 20, 2023
1 parent 37cfba5 commit a246279
Show file tree
Hide file tree
Showing 15 changed files with 1,043 additions and 1,088 deletions.
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry "https://registry.yarnpkg.com"
6 changes: 3 additions & 3 deletions lib/rules/no-missing-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = {

/** @type {{filePath:string,testPaths:string[],hasTestSuffix?:boolean}[]} */
const matchingLocations = config.filter((location) =>
context.getFilename().includes(location.filePath)
context.getFilename().includes(location.filePath),
);

if (matchingLocations.length === 0) {
Expand All @@ -68,11 +68,11 @@ module.exports = {
(testPath) => [
path.join(testPath, `${filename}${suffix}.js`),
path.join(testPath, `${filename}${suffix}.ts`),
]
],
);

const foundMatchingTest = possibleTestPaths.some((possibleTestPath) =>
existsSync(possibleTestPath)
existsSync(possibleTestPath),
);
if (foundMatchingTest) {
// File has corresponding test file.
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/no-restricted-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ module.exports = {
(option) =>
!option.paths ||
option.paths.some(
(path) => !path || context.getFilename().match(path)
)
(path) => !path || context.getFilename().match(path),
),
);
if (match || config.length === 0) {
context.report({
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-test-return-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ module.exports = {
fix(fixer) {
if (!node.range || !node.argument || !node.argument.range) {
throw new Error(
'This is just to make TypeScript happy. Every node should have a range and we already checked that the node has an argument.'
'This is just to make TypeScript happy. Every node should have a range and we already checked that the node has an argument.',
);
}
return fixer.removeRange([
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/use-call-count-test-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ module.exports = {
}
const stub = text.slice(
node.arguments[0].object.range[0] - node.range[0],
node.arguments[0].object.range[1] - node.range[0]
node.arguments[0].object.range[1] - node.range[0],
);

// Convert `calledOnce` to `1`.
Expand All @@ -113,7 +113,7 @@ module.exports = {
node.arguments.length === 2 && node.arguments[1].range
? text.slice(
node.arguments[1].range[0] - node.range[0],
node.arguments[1].range[1] - node.range[0]
node.arguments[1].range[1] - node.range[0],
)
: null;

Expand Down
6 changes: 3 additions & 3 deletions lib/rules/use-ember-find.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@ module.exports = {
// ^^^^^^^^^^^^^^
const afterCalleeThroughFirstArgument = callText.slice(
calleeIndex + calleeText.length,
argumentIndex + argumentText.length
argumentIndex + argumentText.length,
);

// $('.some-class')
// ^
const afterArgument = callText.slice(
argumentIndex + argumentText.length
argumentIndex + argumentText.length,
);

// find('.some-class', 'body')
// ^^^^ ^^^^^^^^
return fixer.replaceText(
node,
`${beforeCallee}find${afterCalleeThroughFirstArgument}, 'body'${afterArgument}`
`${beforeCallee}find${afterCalleeThroughFirstArgument}, 'body'${afterArgument}`,
);
},
});
Expand Down
8 changes: 4 additions & 4 deletions lib/utils/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ function getSourceModuleNameForIdentifier(context, node) {
(importDeclaration) =>
importDeclaration.type === 'ImportDeclaration' &&
importDeclaration.specifiers.some(
(specifier) => specifier.local.name === sourceModuleName
)
(specifier) => specifier.local.name === sourceModuleName,
),
);

return importDeclaration &&
Expand All @@ -57,7 +57,7 @@ function getSourceModuleName(node) {
} else {
assert(
false,
'`getSourceModuleName` should only be called on a `CallExpression`, `MemberExpression` or `Identifier`'
'`getSourceModuleName` should only be called on a `CallExpression`, `MemberExpression` or `Identifier`',
);
return undefined;
}
Expand All @@ -74,7 +74,7 @@ function getSourceModuleName(node) {
function getImportIdentifier(node, source, namedImportIdentifier = undefined) {
assert(
node && node.type === 'ImportDeclaration',
`getImportIdentifier should be called with a node that's type is 'ImportDeclaration'. You passed '${node.type}'`
`getImportIdentifier should be called with a node that's type is 'ImportDeclaration'. You passed '${node.type}'`,
);

if (node.source.value !== source) {
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,40 +58,40 @@
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-qunit": "^7.3.4",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-qunit": "^8.0.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unicorn": "^48.0.1",
"eslint-utils": "^3.0.0",
"espree": "^9.5.1",
"prettier": "^2.8.7",
"prettier": "^3.0.3",
"requireindex": "^1.2.0"
},
"devDependencies": {
"@babel/eslint-parser": "^7.22.15",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.22.7",
"@release-it-plugins/lerna-changelog": "^5.0.0",
"@release-it-plugins/lerna-changelog": "^6.0.0",
"@square/prettier-config": "^1.0.0",
"@types/eslint": "^8.37.0",
"@types/eslint-utils": "^3.0.2",
"@types/estree": "^1.0.1",
"@types/jest": "^29.5.2",
"@types/requireindex": "^1.2.0",
"@typescript-eslint/parser": "^5.62.0",
"@typescript-eslint/parser": "^6.8.0",
"eslint": "^8.40.0",
"eslint-doc-generator": "^1.0.2",
"eslint-plugin-eslint-plugin": "^5.1.1",
"eslint-plugin-markdown": "^3.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-square": "file:./",
"markdownlint-cli": "^0.35.0",
"markdownlint-cli": "^0.37.0",
"mocha": "^10.2.0",
"npm-package-json-lint": "^7.0.0",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"release-it": "^15.11.0",
"release-it": "^16.2.1",
"sort-package-json": "^2.5.1",
"typescript": "^5.1.6"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/config-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('config setup is correct', function () {
CONFIG_NAMES,
files
.filter((file) => !file.startsWith('.'))
.map((file) => file.replace('.js', ''))
.map((file) => file.replace('.js', '')),
);
});

Expand Down
4 changes: 2 additions & 2 deletions tests/lib/rules/no-missing-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ const ruleTester = new RuleTester();

const RULES_TESTS_PATH = __dirname;
const RULES_LIB_PATH = path.normalize(
path.join(__dirname, '..', '..', '..', 'lib', 'rules')
path.join(__dirname, '..', '..', '..', 'lib', 'rules'),
);
const RULE_FILE = path.join(RULES_LIB_PATH, 'no-missing-tests.js');
const RANDOM_FILE = path.normalize(
path.join(__dirname, '..', '..', '..', 'lib', 'index.js')
path.join(__dirname, '..', '..', '..', 'lib', 'index.js'),
);

ruleTester.run('no-missing-tests', rule, {
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/rules/use-call-count-test-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const VALID_HELPER_USAGES_1 = ASSERT_PROPERTY_NAMES.map(
code: `assert.${assertPropertyName}(myBool);`,
filename: TEST_FILE_NAME,
};
}
},
);

const VALID_HELPER_USAGES_2 = STUB_PROPERTY_NAMES.map((stubPropertyName) => {
Expand Down Expand Up @@ -116,7 +116,7 @@ const INVALID_HELPER_USAGES = ASSERT_PROPERTY_NAMES.flatMap(

return [ex1, ex2, ex3];
});
}
},
);

ruleTester.run('use-call-count-test-assert', rule, {
Expand Down
26 changes: 13 additions & 13 deletions tests/lib/utils/imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,30 @@ function parseCallExpression(code) {
return parsed.body[0].expression;
}
throw new Error(
'Expected first statement in body to be an ExpressionStatement of a CallExpression.'
'Expected first statement in body to be an ExpressionStatement of a CallExpression.',
);
}

describe('getSourceModuleNameForIdentifier', () => {
it('gets the correct module name from an imported method', () => {
const context = new FauxContext(
"import { someMethod } from 'some-service';"
"import { someMethod } from 'some-service';",
);
const node = parseCallExpression('someMethod()').callee;
assert.strictEqual(
importUtils.getSourceModuleNameForIdentifier(context, node),
'some-service'
'some-service',
);
});

it('gets the correct module name from an imported aliased method', () => {
const context = new FauxContext(
"import { someMethod as aliasMethod } from 'some-service';"
"import { someMethod as aliasMethod } from 'some-service';",
);
const node = parseCallExpression('aliasMethod()').callee;
assert.strictEqual(
importUtils.getSourceModuleNameForIdentifier(context, node),
'some-service'
'some-service',
);
});
});
Expand Down Expand Up @@ -69,7 +69,7 @@ describe('getSourceModuleName', () => {
} catch (/** @type {any} */ err) {
assert.strictEqual(
err.message,
'`getSourceModuleName` should only be called on a `CallExpression`, `MemberExpression` or `Identifier`'
'`getSourceModuleName` should only be called on a `CallExpression`, `MemberExpression` or `Identifier`',
);
assert.strictEqual(err.actual, false);
}
Expand All @@ -82,7 +82,7 @@ describe('getImportIdentifier', () => {
.body[0];
assert.strictEqual(
importUtils.getImportIdentifier(node, '@ember/object', 'action'),
undefined
undefined,
);
});

Expand All @@ -92,20 +92,20 @@ describe('getImportIdentifier', () => {
const identifier = importUtils.getImportIdentifier(
node,
'@ember/runloop',
'later'
'later',
);

assert.strictEqual(identifier, 'later');
});

it('gets an aliased identifier when found', () => {
const node = babelESLintParse(
"import { later as laterz } from '@ember/runloop';"
"import { later as laterz } from '@ember/runloop';",
).body[0];
const identifier = importUtils.getImportIdentifier(
node,
'@ember/runloop',
'later'
'later',
);

assert.strictEqual(identifier, 'laterz');
Expand All @@ -124,7 +124,7 @@ describe('getImportIdentifier', () => {
.body[0];
const identifier = importUtils.getImportIdentifier(
node,
'@ember/component'
'@ember/component',
);

assert.strictEqual(identifier, 'Component');
Expand All @@ -136,7 +136,7 @@ describe('getImportIdentifier', () => {
const identifier = importUtils.getImportIdentifier(
node,
'@ember/runloop',
'later'
'later',
);

assert.strictEqual(identifier, 'later');
Expand All @@ -147,7 +147,7 @@ describe('getImportIdentifier', () => {
.body[0];
const identifier = importUtils.getImportIdentifier(
node,
'@ember/component'
'@ember/component',
);

assert.strictEqual(identifier, 'Component');
Expand Down
12 changes: 6 additions & 6 deletions tests/rule-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('rules setup is correct', function () {
RULE_NAMES,
files
.filter((file) => !file.startsWith('.'))
.map((file) => file.replace('.js', ''))
.map((file) => file.replace('.js', '')),
);
});

Expand All @@ -32,7 +32,7 @@ describe('rules setup is correct', function () {
RULE_NAMES,
files
.filter((file) => !file.startsWith('.'))
.map((file) => file.replace('.js', ''))
.map((file) => file.replace('.js', '')),
);
});

Expand All @@ -44,23 +44,23 @@ describe('rules setup is correct', function () {
RULE_NAMES,
files
.filter((file) => !file.startsWith('.') && !file.startsWith('_'))
.map((file) => file.replace('.md', ''))
.map((file) => file.replace('.md', '')),
);
});

describe('rule files', function () {
const TYPE_ANNOTATION = "/** @type {import('eslint').Rule.RuleModule} */";
const TYPE_ANNOTATION_UNCLOSED = TYPE_ANNOTATION.slice(
0,
Math.max(0, TYPE_ANNOTATION.lastIndexOf('}'))
Math.max(0, TYPE_ANNOTATION.lastIndexOf('}')),
); // Allow for & in the type annotation.
for (const ruleName of RULE_NAMES) {
const filePath = path.join(
__dirname,
'..',
'lib',
'rules',
`${ruleName}.js`
`${ruleName}.js`,
);
const file = readFileSync(filePath, 'utf8');

Expand All @@ -69,7 +69,7 @@ describe('rules setup is correct', function () {
assert.ok(
file.includes(TYPE_ANNOTATION) ||
file.includes(TYPE_ANNOTATION_UNCLOSED),
`includes jsdoc comment for rule type: ${TYPE_ANNOTATION}`
`includes jsdoc comment for rule type: ${TYPE_ANNOTATION}`,
);
});
});
Expand Down
4 changes: 2 additions & 2 deletions types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
declare module '@babel/eslint-parser' {
export function parse(
code: string,
options?: { babelOptions?: { configFile: string } }
options?: { babelOptions?: { configFile: string } },
): import('eslint').AST.Program;

export function parseForESLint(
code: string,
options?: { babelOptions?: { configFile: string } }
options?: { babelOptions?: { configFile: string } },
): import('eslint').SourceCode;
}
Loading

0 comments on commit a246279

Please sign in to comment.