-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat: create core/base for react/node/legacy lint configs #22128
Changes from all commits
0c0d289
d0cf279
459a2f5
f2bb71e
a4e0b2a
3fa8c72
7428691
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "none", | ||
"comment": "style: fix lint errors", | ||
"packageName": "@fluentui/api-docs", | ||
"email": "[email protected]", | ||
"dependentChangeType": "none" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "none", | ||
"comment": "style: fix lint errors", | ||
"packageName": "@fluentui/codemods", | ||
"email": "[email protected]", | ||
"dependentChangeType": "none" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "feat: create core base for react/node/legacy lint configs", | ||
"packageName": "@fluentui/eslint-plugin", | ||
"email": "[email protected]", | ||
"dependentChangeType": "none" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"extends": ["plugin:@fluentui/eslint-plugin/node"], | ||
"extends": ["plugin:@fluentui/eslint-plugin/node", "plugin:@fluentui/eslint-plugin/react"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like This will need additional refactoring/checking across whole monorepo |
||
"root": true, | ||
"overrides": [ | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,8 +73,10 @@ export class CommandParser { | |
} | ||
if (parsed.list) { | ||
const mods = getEnabledMods(console, getModsPaths); | ||
// eslint-disable-next-line no-console | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lint errors that appeared during config reshuffling |
||
console.log('Here are the enabled code mod names:\n'); | ||
mods.forEach(mod => { | ||
// eslint-disable-next-line no-console | ||
console.log(mod.name); | ||
}); | ||
return { shouldExit: true, modsFilter: () => true }; | ||
|
@@ -86,6 +88,7 @@ export class CommandParser { | |
if (configResult.ok) { | ||
configObj = configResult.value; | ||
} else { | ||
// eslint-disable-next-line no-console | ||
console.log(configResult.value); | ||
return { shouldExit: true, modsFilter: () => true }; | ||
} | ||
|
@@ -115,6 +118,7 @@ function getModRunnerConfig(): Result<ModRunnerConfigType, ModError> { | |
sync: true, | ||
}); | ||
let configObj: ModRunnerConfigType = { stringFilters: [], regexFilters: [], includeMods: false }; | ||
// eslint-disable-next-line no-console | ||
console.log('Configuration detected. Attempting to run mods from config...'); | ||
if (!foundJsonFile.found || foundJsonFile.found.length !== 1) { | ||
return Err<ModRunnerConfigType, ModError>({ error: new Error('Error, could not locate correct config file.') }); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// @ts-check | ||
|
||
const path = require('path'); | ||
|
||
const { getNamingConventionRule } = require('../utils/configHelpers'); | ||
|
||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
extends: [path.join(__dirname, 'core')], | ||
rules: { | ||
/** | ||
* `@typescript-eslint`plugin eslint rules | ||
* @see https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin | ||
*/ | ||
...getNamingConventionRule({ prefixInterface: true }), | ||
}, | ||
overrides: [], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// @ts-check | ||
|
||
const path = require('path'); | ||
|
||
const { getNamingConventionRule } = require('../utils/configHelpers'); | ||
|
||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
extends: [path.join(__dirname, 'core')], | ||
rules: { | ||
/** | ||
* `@typescript-eslint`plugin eslint rules | ||
* @see https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin | ||
*/ | ||
...getNamingConventionRule(), | ||
}, | ||
overrides: [ | ||
{ | ||
files: '**/src/index.{ts,tsx,js}', | ||
rules: { | ||
// TODO: propagate to `error` once all packages barrel files have been fixed | ||
'@rnx-kit/no-export-all': ['warn', { expand: 'all' }], | ||
}, | ||
}, | ||
], | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome that you set
dependentChangeType
tonone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
learned my lesson from the best ;)