Skip to content

Commit 64213a1

Browse files
authored
chore: migrate charts and wc to flat configs (#35544)
1 parent abd28e6 commit 64213a1

31 files changed

+303
-240
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "chore: migrate to eslint flat configs",
4+
"packageName": "@fluentui/chart-utilities",
5+
"email": "vgenaev@gmail.com",
6+
"dependentChangeType": "none"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "chore: migrate to eslint flat configs",
4+
"packageName": "@fluentui/chart-web-components",
5+
"email": "vgenaev@gmail.com",
6+
"dependentChangeType": "none"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "chore: migrate to eslint flat configs",
4+
"packageName": "@fluentui/react-charting",
5+
"email": "vgenaev@gmail.com",
6+
"dependentChangeType": "none"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "chore: migrate to eslint flat configs",
4+
"packageName": "@fluentui/react-charts",
5+
"email": "vgenaev@gmail.com",
6+
"dependentChangeType": "none"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "chore: migrate to eslint flat configs",
4+
"packageName": "@fluentui/web-components",
5+
"email": "vgenaev@gmail.com",
6+
"dependentChangeType": "none"
7+
}

packages/charts/chart-utilities/.eslintrc.json

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// @ts-check
2+
const fluentPlugin = require('@fluentui/eslint-plugin');
3+
4+
/** @type {import("eslint").Linter.Config[]} */ module.exports = [
5+
...fluentPlugin.configs['flat/react-legacy'],
6+
{
7+
ruels: {
8+
'no-restricted-globals': 'off',
9+
},
10+
},
11+
];

packages/charts/chart-web-components/.eslintignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/charts/chart-web-components/.eslintrc.json

Lines changed: 0 additions & 74 deletions
This file was deleted.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
// @ts-check
2+
import tseslint from 'typescript-eslint';
3+
import importPlugin from 'eslint-plugin-import';
4+
import playwright from 'eslint-plugin-playwright';
5+
import eslintJs from '@eslint/js';
6+
7+
/** @type {import("eslint").Linter.Config[]} */
8+
export default [
9+
{
10+
ignores: ['dist', 'coverage', '.storybook'],
11+
},
12+
eslintJs.configs.recommended,
13+
...tseslint.configs.recommended,
14+
{
15+
plugins: {
16+
import: importPlugin,
17+
playwright: playwright,
18+
},
19+
languageOptions: {
20+
parser: tseslint.parser,
21+
},
22+
settings: {
23+
react: {
24+
version: 'latest',
25+
},
26+
},
27+
rules: {
28+
'no-empty': [
29+
'error',
30+
{
31+
allowEmptyCatch: true,
32+
},
33+
],
34+
'no-extra-boolean-cast': 'off',
35+
'no-prototype-builtins': 'off',
36+
'no-fallthrough': 'off',
37+
'no-unexpected-multiline': 'off',
38+
'no-useless-escape': 'off',
39+
'import/order': 'error',
40+
'sort-imports': [
41+
'error',
42+
{
43+
ignoreCase: true,
44+
ignoreDeclarationSort: true,
45+
},
46+
],
47+
'comma-dangle': 'off',
48+
'@typescript-eslint/no-non-null-assertion': 'off',
49+
'@typescript-eslint/no-use-before-define': 'off',
50+
'@typescript-eslint/no-empty-interface': 'error',
51+
'@typescript-eslint/no-empty-object-type': 'off',
52+
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
53+
'@typescript-eslint/explicit-module-boundary-types': 'off',
54+
'@typescript-eslint/explicit-function-return-type': 'off',
55+
'@typescript-eslint/camelcase': 'off',
56+
'@typescript-eslint/no-inferrable-types': 'off',
57+
'@typescript-eslint/no-unused-vars': [
58+
'warn',
59+
{
60+
args: 'none',
61+
},
62+
],
63+
'@typescript-eslint/no-unused-expressions': 'warn',
64+
'@typescript-eslint/no-explicit-any': 'off',
65+
'@typescript-eslint/naming-convention': [
66+
'error',
67+
{
68+
selector: 'default',
69+
format: ['UPPER_CASE', 'camelCase', 'PascalCase'],
70+
leadingUnderscore: 'allow',
71+
},
72+
{
73+
selector: 'property',
74+
format: null, // disable for property names because of our foo__expanded convention for JSS
75+
// TODO: I think we can come up with a regex that ignores variables with __ in them
76+
},
77+
{
78+
selector: 'variable',
79+
format: null, // disable for variable names because of our foo__expanded convention for JSS
80+
// TODO: I think we can come up with a regex that ignores variables with __ in them
81+
},
82+
],
83+
...playwright.configs['flat/recommended'].rules,
84+
},
85+
},
86+
{
87+
files: ['scripts/**/*.js', 'scripts/**/*.cjs'],
88+
rules: {
89+
'no-undef': 'off',
90+
},
91+
},
92+
];

0 commit comments

Comments
 (0)