airbnb / airbnb/javascript

Pull in filenames/match-exported

Open
#1,185 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
148k
Forks
26.6k
PR merge metrics
No merged PRs in 30d

Description

```js
// Considered problem only if the file isn't named foo.js or foo/index.js
export default function foo() {}

// Considered problem only if the file isn't named Foo.js or Foo/index.js
module.exports = class Foo() {}

// Considered problem only if the file isn't named someVariable.js or someVariable/index.js
module.exports = someVariable;

// Never considered a problem
export default { foo: "bar" };
```

https://www.npmjs.com/package/eslint-plugin-filenames#matching-exported-values-match-exported

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the match-exported rule documentation at the linked npm package and compare its examples with the desired behavior in this issue. Then locate the repository's ESLint rule configuration and related tests, and verify that exported functions, classes, and variables are checked against filenames while exported objects are ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.