Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Commit ad4ab04

Browse files
committed
Use eslint and prettier
1 parent e634d36 commit ad4ab04

39 files changed

+2106
-767
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test/fixtures/*
2+
coverage/**
3+
.nyc_output/**

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
parserOptions: {
3+
ecmaVersion: 2019,
4+
},
5+
extends: ['stylelint', 'prettier'],
6+
rules: {
7+
'jest/valid-expect': 'off',
8+
},
9+
};

.github/workflows/nodejs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ on:
44
push:
55
branches:
66
- master
7-
- "dependabot/**"
7+
- 'dependabot/**'
88
pull_request:
99
branches:
10-
- "**"
10+
- '**'
1111

1212
env:
1313
CI: true

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
*.pid
33
*.seed
44
.editorconfig
5+
.eslintignore
56
.eslintrc*
67
.git
8+
.github
79
.gitignore
810
.grunt
911
.lock-wscript
1012
.node_repl_history
1113
.nyc_output
14+
.prettierrc.js
15+
.prettierignore
1216
.stylelintrc*
1317
.travis.yml
1418
.vscode

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test/fixtures/*
2+
coverage/**
3+
.nyc_output/**

.prettierrc.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
'use strict';
2+
3+
// https://prettier.io/docs/en/options.html
4+
module.exports = {
5+
arrowParens: 'always',
6+
endOfLine: 'lf',
7+
printWidth: 100,
8+
singleQuote: true,
9+
trailingComma: 'es5',
10+
useTabs: true,
11+
overrides: [
12+
{
13+
files: ['package.json', 'package-lock.json', '*.md'],
14+
options: {
15+
printWidth: 80,
16+
singleQuote: false,
17+
tabWidth: 2,
18+
trailingComma: 'none',
19+
useTabs: false,
20+
},
21+
},
22+
],
23+
};

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const stylelint = require("stylelint");
4545
const syntax = require("postcss-syntax");
4646
postcss([stylelint({ fix: true })])
4747
.process(source, { syntax: syntax })
48-
.then(function(result) {
48+
.then(function (result) {
4949
// An alias for the result.css property. Use it with syntaxes that generate non-CSS output.
5050
result.content;
5151
});

camel-case.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
"use strict";
2-
function camelCase (str) {
3-
return str.replace(/[\w-]+/g, (s) => (
1+
'use strict';
2+
3+
function camelCase(str) {
4+
return str.replace(/[\w-]+/g, (s) =>
45
/^-?[a-z]+(?:-[a-z]+)+$/.test(s)
5-
? s.replace(
6-
/^-(ms|moz|khtml|epub|(\w+-?)*webkit)(?=-)/i,
7-
"$1"
8-
).replace(
9-
/-\w/g,
10-
s => (
11-
s[1].toUpperCase()
12-
)
13-
)
6+
? s
7+
.replace(/^-(ms|moz|khtml|epub|(\w+-?)*webkit)(?=-)/i, '$1')
8+
.replace(/-\w/g, (s) => s[1].toUpperCase())
149
: s
15-
));
10+
);
1611
}
1712

1813
module.exports = camelCase;

0 commit comments

Comments
 (0)