Skip to content

Commit d18735c

Browse files
committed
add jsx files to ESLint
1 parent 85afd03 commit d18735c

4 files changed

Lines changed: 24 additions & 24 deletions

File tree

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
package-lock.json
33
.env
44
/coverage/
5-
build/
5+
public/
66
bin/

jest.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
module.exports = {
2-
roots: ["<rootDir>/src"],
2+
roots: ['<rootDir>/src'],
33
transform: {
4-
"\\.(js|jsx)?$": "babel-jest",
4+
'\\.(js|jsx)?$': 'babel-jest',
55
},
66
// testMatch: ["<rootDir>/src/**/>(*.)test.{js, ts, jsx, tsx}"],
7-
moduleFileExtensions: ["js", "jsx", "json", "node"],
8-
testPathIgnorePatterns: ["/node_modules/", "/public/"],
7+
moduleFileExtensions: ['js', 'jsx', 'json', 'node'],
8+
testPathIgnorePatterns: ['/node_modules/', '/public/'],
99
setupFilesAfterEnv: [
10-
"./src/setupTests.js",
11-
"@testing-library/jest-dom/extend-expect",
10+
'./src/setupTests.js',
11+
'@testing-library/jest-dom/extend-expect',
1212
],
1313
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"test:coverage": "jest --coverage",
1818
"presetup": "npm i shelljs compare-versions",
1919
"setup": "node ./bin/setup.js",
20-
"lint": "eslint --fix src/**/*.js",
20+
"lint": "eslint --ext .js,.jsx . --fix src/**/*.js",
2121
"format": "prettier src/**/*.js --write --config ./.prettierrc"
2222
},
2323
"keywords": [],

webpack.config.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
1-
const webpack = require("webpack");
2-
const path = require("path");
3-
require("dotenv").config();
4-
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
5-
const isDevelopment = process.env.NODE_ENV === "development";
1+
const webpack = require('webpack');
2+
const path = require('path');
3+
require('dotenv').config();
4+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
5+
const isDevelopment = process.env.NODE_ENV === 'development';
66

77
module.exports = {
8-
entry: "./src/index.js",
8+
entry: './src/index.js',
99
output: {
10-
filename: "bundle.js",
11-
path: path.join(__dirname, "public"),
10+
filename: 'bundle.js',
11+
path: path.join(__dirname, 'public'),
1212
},
1313
module: {
1414
rules: [
1515
{
16-
loader: "babel-loader",
16+
loader: 'babel-loader',
1717
test: /\.jsx?$/,
1818
exclude: /node_modules/,
1919
},
2020
{
2121
test: /\.(png|svg|jpg|gif)$/,
22-
use: ["file-loader"],
22+
use: ['file-loader'],
2323
},
2424
{
2525
test: /\.(s*)css$/,
2626
use: [
27-
isDevelopment ? MiniCssExtractPlugin.loader : "style-loader",
28-
"css-loader",
29-
"sass-loader",
27+
isDevelopment ? MiniCssExtractPlugin.loader : 'style-loader',
28+
'css-loader',
29+
'sass-loader',
3030
],
3131
},
3232
],
3333
},
3434
devServer: {
3535
historyApiFallback: true,
36-
contentBase: path.resolve(__dirname, "./public"),
36+
contentBase: path.resolve(__dirname, './public'),
3737
open: true,
3838
compress: true,
3939
hot: true,
4040
port: 8080,
4141
},
4242
plugins: [
4343
new MiniCssExtractPlugin({
44-
filename: "style.css",
44+
filename: 'style.css',
4545
}),
4646
new webpack.HotModuleReplacementPlugin(),
4747
],
4848
resolve: {
49-
extensions: [".js", ".scss", "jsx"],
49+
extensions: ['.js', '.scss', 'jsx'],
5050
},
5151
};

0 commit comments

Comments
 (0)