Skip to content

Commit a656c5f

Browse files
committed
🔧 Update Prettier config
1 parent e975e20 commit a656c5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+338
-341
lines changed

.eslintrc.js

Lines changed: 39 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,62 +5,56 @@ module.exports = {
55
es6: true,
66
},
77
globals: {
8-
window: "readonly",
8+
window: 'readonly',
99
},
10-
parser: "@typescript-eslint/parser",
10+
parser: '@typescript-eslint/parser',
1111
parserOptions: {
12-
parser: "@babel/eslint-parser",
12+
parser: '@babel/eslint-parser',
1313
ecmaVersion: 6,
14-
sourceType: "module",
14+
sourceType: 'module',
1515
},
1616
extends: [
17-
"airbnb",
18-
"plugin:react/recommended",
19-
"plugin:react-hooks/recommended",
20-
"plugin:jsx-a11y/recommended",
21-
"plugin:@typescript-eslint/eslint-recommended",
22-
"plugin:@typescript-eslint/recommended",
23-
"prettier",
17+
'airbnb',
18+
'plugin:react/recommended',
19+
'plugin:react-hooks/recommended',
20+
'plugin:jsx-a11y/recommended',
21+
'plugin:@typescript-eslint/eslint-recommended',
22+
'plugin:@typescript-eslint/recommended',
23+
'prettier',
2424
],
2525
settings: {
26-
"import/resolver": {
26+
'import/resolver': {
2727
node: {
28-
paths: [".", "src"],
29-
extensions: [".js", ".ts"],
28+
paths: ['.', 'src'],
29+
extensions: ['.js', '.ts'],
3030
},
3131
},
3232
},
33-
plugins: [
34-
"prettier",
35-
"react",
36-
"jsx-a11y",
37-
"react-hooks",
38-
"@typescript-eslint",
39-
],
33+
plugins: ['prettier', 'react', 'jsx-a11y', 'react-hooks', '@typescript-eslint'],
4034
rules: {
41-
"import/extensions": "off",
42-
"import/prefer-default-export": "off",
43-
"import/no-webpack-loader-syntax": "off",
44-
"import/no-unresolved": "off",
45-
"import/no-extraneous-dependencies": "off",
46-
"no-use-before-define": "off",
47-
"no-console": "off",
48-
"no-extend-native": "off",
49-
"no-param-reassign": "off",
50-
"class-methods-use-this": "off",
51-
"node/no-unpublished-require": "off",
52-
"node/no-missing-import": "off",
53-
"node/no-unpublished-import": "off",
54-
"dot-notation": ["error", { allowKeywords: true }],
55-
"@typescript-eslint/explicit-module-boundary-types": "off",
56-
"@typescript-eslint/no-explicit-any": "off",
57-
"@typescript-eslint/no-var-requires": "off",
58-
"func-names": "off",
59-
"no-underscore-dangle": "off",
60-
camelcase: "warn",
61-
"no-plusplus": "off",
62-
"no-nested-ternary": "off",
63-
"@typescript-eslint/ban-types": "warn",
64-
"no-unused-expressions": "off",
35+
'import/extensions': 'off',
36+
'import/prefer-default-export': 'off',
37+
'import/no-webpack-loader-syntax': 'off',
38+
'import/no-unresolved': 'off',
39+
'import/no-extraneous-dependencies': 'off',
40+
'no-use-before-define': 'off',
41+
'no-console': 'off',
42+
'no-extend-native': 'off',
43+
'no-param-reassign': 'off',
44+
'class-methods-use-this': 'off',
45+
'node/no-unpublished-require': 'off',
46+
'node/no-missing-import': 'off',
47+
'node/no-unpublished-import': 'off',
48+
'dot-notation': ['error', { allowKeywords: true }],
49+
'@typescript-eslint/explicit-module-boundary-types': 'off',
50+
'@typescript-eslint/no-explicit-any': 'off',
51+
'@typescript-eslint/no-var-requires': 'off',
52+
'func-names': 'off',
53+
'no-underscore-dangle': 'off',
54+
camelcase: 'warn',
55+
'no-plusplus': 'off',
56+
'no-nested-ternary': 'off',
57+
'@typescript-eslint/ban-types': 'warn',
58+
'no-unused-expressions': 'off',
6559
},
6660
};

.prettierrc

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

.prettierrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/** @type {import('prettier').Config} */
2+
const config = {
3+
singleQuote: true,
4+
semi: true,
5+
arrowParens: 'always',
6+
printWidth: 120,
7+
};
8+
9+
module.exports = config;

client/ExtensionCompiler.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { log } from "util";
2-
import * as webpack from "webpack";
3-
import ExtensionReloaderImpl from "../src/ExtensionReloader";
4-
import { info } from "../src/utils/logger";
5-
import { IPluginOptions } from "../typings/webpack-ext-reloader";
1+
import { log } from 'util';
2+
import * as webpack from 'webpack';
3+
import ExtensionReloaderImpl from '../src/ExtensionReloader';
4+
import { info } from '../src/utils/logger';
5+
import { IPluginOptions } from '../typings/webpack-ext-reloader';
66

77
export default class ExtensionCompiler {
88
private static treatErrors(err) {

client/args-parser.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/* eslint-disable no-throw-literal */
2-
import { resolve } from "path";
3-
import { cwd } from "process";
4-
import { log } from "util";
5-
import { DEFAULT_CONFIG, DEFAULT_PORT } from "../src/constants/options.constants";
6-
import { IPluginOptions } from "../typings/webpack-ext-reloader";
7-
import { CONFIG, HELP, MANIFEST, NO_PAGE_RELOAD, PORT } from "./args.constant";
8-
import { SIG_EXIT } from "./events.constants";
9-
import manual from "./manual";
2+
import { resolve } from 'path';
3+
import { cwd } from 'process';
4+
import { log } from 'util';
5+
import { DEFAULT_CONFIG, DEFAULT_PORT } from '../src/constants/options.constants';
6+
import { IPluginOptions } from '../typings/webpack-ext-reloader';
7+
import { CONFIG, HELP, MANIFEST, NO_PAGE_RELOAD, PORT } from './args.constant';
8+
import { SIG_EXIT } from './events.constants';
9+
import manual from './manual';
1010

1111
export default (args: object) => {
1212
if (args[HELP]) {
@@ -28,7 +28,7 @@ export default (args: object) => {
2828

2929
try {
3030
// eslint-disable-next-line no-eval
31-
const webpackConfig = eval("require")(optPath);
31+
const webpackConfig = eval('require')(optPath);
3232
return { webpackConfig, pluginOptions };
3333
} catch (err) {
3434
log(`[Error] Couldn't require the file: ${optPath}`);

client/args.constant.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export const HELP = "help";
2-
export const CONFIG = "config";
3-
export const PORT = "port";
4-
export const NO_PAGE_RELOAD = "no-page-reload";
5-
export const MANIFEST = "manifest";
1+
export const HELP = 'help';
2+
export const CONFIG = 'config';
3+
export const PORT = 'port';
4+
export const NO_PAGE_RELOAD = 'no-page-reload';
5+
export const MANIFEST = 'manifest';

client/events.constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const SIG_EXIT = "SIG_EXIT";
1+
export const SIG_EXIT = 'SIG_EXIT';

client/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import * as minimist from "minimist";
2-
import { install } from "source-map-support";
3-
import { log } from "util";
4-
import argsParser from "./args-parser";
5-
import { SIG_EXIT } from "./events.constants";
6-
import ExtensionCompiler from "./ExtensionCompiler";
1+
import * as minimist from 'minimist';
2+
import { install } from 'source-map-support';
3+
import { log } from 'util';
4+
import argsParser from './args-parser';
5+
import { SIG_EXIT } from './events.constants';
6+
import ExtensionCompiler from './ExtensionCompiler';
77

88
install();
99
// eslint-disable-next-line @typescript-eslint/no-unused-vars

client/manual.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
DEFAULT_CONTENT_SCRIPT_ENTRY,
66
DEFAULT_EXTENSION_PAGE_ENTRY,
77
DEFAULT_PORT,
8-
} from "../src/constants/options.constants";
8+
} from '../src/constants/options.constants';
99

1010
export default () => `
1111
Usage:

sample/src/dependency-sample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import assetContent from "./some-asset.txt";
1+
import assetContent from './some-asset.txt';
22

33
export default () => assetContent;

0 commit comments

Comments
 (0)