-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support formatjs eslint rules (#516)
This adds support for formatjs eslint rules, and adds an `eslint-next`config which includes a rule that ensures all translation source strings have descriptions.
- Loading branch information
1 parent
1427631
commit 4121238
Showing
4 changed files
with
415 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// This file will be removed and replace "eslintrc.js" once all MFEs are ready | ||
const { babel } = require('../lib/presets'); | ||
|
||
module.exports = { | ||
plugins: ['formatjs'], | ||
extends: '@edx/eslint-config', | ||
parser: '@babel/eslint-parser', | ||
parserOptions: { | ||
requireConfigFile: true, | ||
babelOptions: { | ||
configFile: babel.resolvedFilepath || babel.defaultFilepath, | ||
}, | ||
}, | ||
rules: { | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ | ||
devDependencies: [ | ||
'**/*.config.*', | ||
'**/*.test.*', | ||
'**/setupTest.js', | ||
], | ||
}, | ||
], | ||
'import/no-unresolved': [ | ||
'error', | ||
{ | ||
ignore: [ | ||
'env.config', | ||
], | ||
}, | ||
], | ||
// https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/340#issuecomment-338424908 | ||
'jsx-a11y/anchor-is-valid': ['error', { | ||
components: ['Link'], | ||
specialLink: ['to'], | ||
}], | ||
'formatjs/enforce-description': ['error', 'literal'], | ||
'import/no-import-module-export': 'off', | ||
'react/function-component-definition': [2, { namedComponents: 'arrow-function' }], | ||
}, | ||
globals: { | ||
newrelic: false, | ||
}, | ||
ignorePatterns: [ | ||
'module.config.js', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.