brandongregoryscott / eslint-plugin-collation

ESLint plugin for making your code easier to read, with autofix and TypeScript support
https://eslint-plugin-collation.brandonscott.me
Apache License 2.0
4 stars 0 forks source link

Rule: `default-export-matches-file` #54

Open brandongregoryscott opened 2 years ago

brandongregoryscott commented 2 years ago

Inspired by these eslint-plugin-import rules:

import/no-named-as-default import/no-anonymous-default-export

Implement a rule that ensures default exports match their filename (in some sort of casing, we can add additional configuration options for specific casing later - default should probably be camelCase)

// noop.ts
export default function foo() {};

would be transformed to:

// noop.ts
export default function noop() {};