11module . exports = {
2- extends : [ 'airbnb' , 'plugin:prettier/recommended' ] ,
3- env : {
4- browser : true ,
5- node : true ,
6- } ,
72 overrides : [
83 {
9- files : [ '**/*.tsx' ] ,
10- plugins : [ '@typescript-eslint' , 'react-hooks' ] ,
4+ files : [ '**/*.{js,jsx}' ] ,
5+ extends : [ 'airbnb' , 'prettier' ] ,
6+ env : { node : true } ,
7+ } ,
8+ {
9+ files : [ '**/*.{ts,tsx}' ] ,
10+ extends : [ 'airbnb' , 'prettier' , 'plugin:@typescript-eslint/recommended' ] ,
11+ plugins : [ '@typescript-eslint' ] ,
12+ env : { browser : true , node : true } ,
1113 parser : '@typescript-eslint/parser' ,
12- parserOptions : {
13- ecmaFeatures : {
14- jsx : true ,
15- } ,
14+ settings : { 'import/resolver' : { typescript : { } } } ,
15+ rules : {
16+ 'no-use-before-define' : 'off' ,
17+ '@typescript-eslint/no-use-before-define' : 'warn' ,
18+ 'import/prefer-default-export' : 'off' ,
19+ 'import/extensions' : 'off' ,
1620 } ,
21+ } ,
22+ {
23+ files : [ '**/*.tsx' ] ,
1724 extends : [
18- 'plugin:@typescript-eslint/recommended' ,
1925 'airbnb/hooks' ,
2026 'plugin:react/recommended' ,
2127 'plugin:jsx-a11y/recommended' ,
22- 'plugin:prettier/recommended' ,
2328 ] ,
24- settings : {
25- react : {
26- version : 'detect' ,
27- } ,
28- 'import/resolver' : {
29- typescript : { } ,
30- } ,
31- } ,
29+ plugins : [ '@typescript-eslint' , 'react-hooks' ] ,
30+ parserOptions : { ecmaFeatures : { jsx : true } } ,
31+ settings : { react : { version : 'detect' } } ,
3232 rules : {
3333 'react/no-unused-prop-types' : 'off' ,
3434 'react/require-default-props' : 'off' ,
3535 'react/jsx-filename-extension' : 'off' ,
3636 'react-hooks/rules-of-hooks' : 'error' ,
3737 'react-hooks/exhaustive-deps' : 'warn' ,
38- 'no-use-before-define' : 'off' ,
39- '@typescript-eslint/no-use-before-define' : 'warn' ,
40- 'import/extensions' : 'off' ,
4138 'consistent-return' : 'off' ,
4239 'react/function-component-definition' : [
4340 'error' ,
@@ -48,48 +45,37 @@ module.exports = {
4845 ] ,
4946 } ,
5047 } ,
51- {
52- files : [ '**/*.ts' ] ,
53- plugins : [ '@typescript-eslint' , 'react-hooks' ] ,
54- parser : '@typescript-eslint/parser' ,
55- settings : {
56- 'import/resolver' : {
57- typescript : { } ,
58- } ,
59- } ,
60- extends : [
61- 'plugin:@typescript-eslint/recommended' ,
62- 'plugin:prettier/recommended' ,
63- ] ,
64- rules : {
65- 'no-use-before-define' : 'off' ,
66- '@typescript-eslint/no-use-before-define' : 'warn' ,
67- 'import/prefer-default-export' : 'off' ,
68- 'import/extensions' : 'off' ,
69- } ,
70- } ,
7148 {
7249 files : [
7350 'test-processor.js' ,
7451 'test-setup.js' ,
75- 'test/**' ,
76- '**/**.test.js' ,
77- '**/**.test.ts' ,
78- '**/**.test.tsx' ,
52+ 'test/**/**.{js,jsx,ts,tsx}' ,
53+ '**/**.test.{js,jsx,ts,tsx}' ,
7954 ] ,
8055 extends : [ 'plugin:testing-library/react' ] ,
81- env : {
82- jest : true ,
83- } ,
56+ env : { jest : true , node : true , browser : true } ,
8457 } ,
8558 {
86- files : [ '**/*.md' ] ,
87- plugins : [ 'markdown' ] ,
88- processor : 'markdown/markdown' ,
59+ // Disable linting for API as some parts are just not compatible with MDXv2
60+ files : [ 'content/**/*.{md,mdx}' ] ,
61+ extends : [ 'plugin:mdx/recommended' ] ,
62+ settings : { 'mdx/code-blocks' : false } ,
63+ rules : { 'react/jsx-no-undef' : 'off' } ,
64+ } ,
65+ {
66+ files : [
67+ 'content/about/*.{md,mdx}' ,
68+ 'content/download/*.{md,mdx}' ,
69+ 'content/get-involved/*.{md,mdx}' ,
70+ 'content/homepage/*.{md,mdx}' ,
71+ 'content/learn/*.m{md,mdx}' ,
72+ ] ,
73+ settings : { 'mdx/code-blocks' : true } ,
8974 } ,
9075 {
91- files : [ '**/*.md /*.js' , '**/*.md/*.ts '] ,
76+ files : [ 'content/ **/*.{md,mdx} /*.{js,jsx,cjs,mjs,ts,tsx} ' ] ,
9277 rules : {
78+ camelcase : 'off' ,
9379 '@typescript-eslint/no-unused-vars' : 'off' ,
9480 'consistent-return' : 'off' ,
9581 'func-names' : 'off' ,
0 commit comments