Skip to content

Commit eeb376f

Browse files
fix: config files
Signed-off-by: Madina <madinaamankeldinova5@gmail.com>
1 parent b551525 commit eeb376f

File tree

6 files changed

+4070
-3956
lines changed

6 files changed

+4070
-3956
lines changed

.eslintignore

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

.eslintrc.js

Lines changed: 0 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +0,0 @@
1-
module.exports = {
2-
3-
"env": {
4-
"browser": true,
5-
"es6": true,
6-
"node": true,
7-
"amd": true
8-
},
9-
"settings": {
10-
"react": {
11-
"version": "detect"
12-
}
13-
},
14-
"extends": [
15-
"eslint:recommended",
16-
"plugin:react/recommended"
17-
],
18-
"parser": "@babel/eslint-parser",
19-
"parserOptions": {
20-
"ecmaFeatures": {
21-
"jsx": true
22-
},
23-
"ecmaVersion": 2018,
24-
"sourceType": "module"
25-
},
26-
"plugins": [
27-
"react"
28-
],
29-
"rules": {
30-
"array-bracket-spacing": ["error", "never"],
31-
"comma-style": ["error"],
32-
"arrow-spacing": [
33-
"error",
34-
{
35-
"after": true,
36-
"before": true
37-
}
38-
],
39-
"block-scoped-var": "error",
40-
"block-spacing": "error",
41-
"brace-style": [
42-
"error",
43-
"1tbs"
44-
],
45-
"jsx-quotes": ["error", "prefer-double"],
46-
"keyword-spacing": "error",
47-
"key-spacing": ["error", {
48-
"beforeColon": false,
49-
"afterColon": true,
50-
}],
51-
"no-unused-vars": [
52-
"warn",
53-
{
54-
"varsIgnorePattern": "React"
55-
}
56-
],
57-
"no-trailing-spaces": "error",
58-
"object-curly-spacing": ["error", "always"],
59-
"react/display-name": 0,
60-
"react/prop-types": 0,
61-
"react/no-unescaped-entities": [0],
62-
"react/jsx-no-duplicate-props": [0],
63-
"indent": [
64-
"error", 2, {
65-
"FunctionExpression": { "parameters": "first" },
66-
"FunctionDeclaration": { "parameters": "first" },
67-
"MemberExpression": 1,
68-
"SwitchCase": 1,
69-
"outerIIFEBody": 0,
70-
"VariableDeclarator": { "var": 2, "let": 2, "const": 3 },
71-
ignoredNodes: ["TemplateLiteral"]
72-
}
73-
],
74-
"linebreak-style": [
75-
"error",
76-
"unix"
77-
],
78-
"quotes": [
79-
"error",
80-
"double"
81-
],
82-
"semi": [
83-
"error",
84-
"always"
85-
],
86-
"strict": 0,
87-
"valid-typeof": 0,
88-
"space-unary-ops": [
89-
1, {
90-
"words": true,
91-
"nonwords": false
92-
}
93-
],
94-
"space-infix-ops": [
95-
"error"
96-
]
97-
}
98-
};

eslint.config.js

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
const js = require('@eslint/js');
2+
const globals = require('globals');
3+
const react = require('eslint-plugin-react');
4+
const babelParser = require('@babel/eslint-parser');
5+
6+
module.exports = [
7+
{
8+
ignores: [
9+
'node_modules/',
10+
'**/*.test.js',
11+
'src/utils/',
12+
'.cache/',
13+
'.github/',
14+
'assets/',
15+
'public/',
16+
'.babelrc',
17+
'.env.development',
18+
'CNAME',
19+
'CODE_OF_CONDUCT.md',
20+
'CODEOWNERS',
21+
'font-preload-cache.json',
22+
'LICENSE',
23+
'Makefile',
24+
'README.md',
25+
'package.json',
26+
'package-lock.json',
27+
'static/'
28+
]
29+
},
30+
js.configs.recommended,
31+
{
32+
files: ['**/*.{js,jsx,mjs,cjs}'],
33+
plugins: {
34+
react
35+
},
36+
languageOptions: {
37+
parser: babelParser,
38+
ecmaVersion: 2018,
39+
sourceType: 'module',
40+
parserOptions: {
41+
ecmaFeatures: {
42+
jsx: true
43+
}
44+
},
45+
globals: {
46+
...globals.browser,
47+
...globals.es6,
48+
...globals.node,
49+
...globals.amd
50+
}
51+
},
52+
settings: {
53+
react: {
54+
version: 'detect'
55+
}
56+
},
57+
rules: {
58+
...react.configs.recommended.rules,
59+
60+
'array-bracket-spacing': ['error', 'never'],
61+
'object-curly-spacing': ['error', 'always'],
62+
63+
'comma-style': ['error'],
64+
'arrow-spacing': [
65+
'error',
66+
{
67+
'after': true,
68+
'before': true
69+
}
70+
],
71+
72+
'block-scoped-var': 'error',
73+
'block-spacing': 'error',
74+
'brace-style': [
75+
'error',
76+
'1tbs'
77+
],
78+
79+
'jsx-quotes': ['error', 'prefer-double'],
80+
'quotes': [
81+
'error',
82+
'double'
83+
],
84+
85+
'keyword-spacing': 'error',
86+
'key-spacing': ['error', {
87+
'beforeColon': false,
88+
'afterColon': true
89+
}],
90+
'space-unary-ops': [
91+
1, {
92+
'words': true,
93+
'nonwords': false
94+
}
95+
],
96+
'space-infix-ops': ['error'],
97+
'no-trailing-spaces': 'error',
98+
99+
'no-unused-vars': [
100+
'warn',
101+
{
102+
'varsIgnorePattern': 'React'
103+
}
104+
],
105+
106+
'indent': [
107+
'error', 2, {
108+
'FunctionExpression': { 'parameters': 'first' },
109+
'FunctionDeclaration': { 'parameters': 'first' },
110+
'MemberExpression': 1,
111+
'SwitchCase': 1,
112+
'outerIIFEBody': 0,
113+
'VariableDeclarator': { 'var': 2, 'let': 2, 'const': 3 },
114+
'ignoredNodes': ['TemplateLiteral']
115+
}
116+
],
117+
118+
'linebreak-style': [
119+
'error',
120+
'unix'
121+
],
122+
'semi': [
123+
'error',
124+
'always'
125+
],
126+
127+
'strict': 0,
128+
'valid-typeof': 0,
129+
130+
'react/display-name': 0,
131+
'react/prop-types': 0,
132+
'react/no-unescaped-entities': [0],
133+
'react/jsx-no-duplicate-props': [0]
134+
}
135+
}
136+
];

gatsby-node.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const slugify = require("./src/utils/slugify");
1010
const { paginate } = require("gatsby-awesome-pagination");
1111
const { createFilePath } = require("gatsby-source-filesystem");
1212
const config = require("./gatsby-config");
13+
const ESLintWebpackPlugin = require("eslint-webpack-plugin");
14+
1315
const {
1416
componentsData,
1517
} = require("./src/sections/Projects/Sistent/components/content");
@@ -1067,7 +1069,18 @@ exports.onCreateWebpackConfig = ({ actions, stage, getConfig }) => {
10671069
if (miniCssExtractPlugin) {
10681070
miniCssExtractPlugin.options.ignoreOrder = true;
10691071
}
1072+
config.plugins = config.plugins.filter(
1073+
(plugin) => plugin.constructor.name !== "ESLintWebpackPlugin"
1074+
);
10701075

1076+
config.plugins.push(
1077+
new ESLintWebpackPlugin({
1078+
extensions: ["js", "jsx", "mjs", "cjs"],
1079+
exclude: ["node_modules", ".cache", "public"],
1080+
emitWarning: true,
1081+
failOnError: false,
1082+
})
1083+
);
10711084
actions.replaceWebpackConfig(config);
10721085
}
10731086
};

0 commit comments

Comments
 (0)