-
-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
79 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
!/.* | ||
/build/ | ||
/test-config/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,6 @@ jobs: | |
|
||
- name: Prettier | ||
run: npx --no-install prettier --check . | ||
|
||
- name: Build | ||
run: npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/build/ | ||
/node_modules/ | ||
/test-config/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/build/ | ||
/test-config/ | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "eslint-config-prettier", | ||
"version": "6.15.0", | ||
"license": "MIT", | ||
"author": "Simon Lydell", | ||
"description": "Turns off all rules that are unnecessary or might conflict with Prettier.", | ||
"repository": "prettier/eslint-config-prettier", | ||
"bin": "bin/cli.js", | ||
"keywords": ["eslint", "eslintconfig", "prettier"], | ||
"peerDependencies": { | ||
"eslint": ">=7.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"use strict"; | ||
|
||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
const DIR = path.join(__dirname, ".."); | ||
const BUILD = path.join(DIR, "build"); | ||
|
||
const READ_MORE = | ||
"**[➡️ Full readme](https://github.com/prettier/eslint-config-prettier/)**"; | ||
|
||
const FILES_TO_COPY = [ | ||
{ src: "LICENSE" }, | ||
{ src: "package-real.json", dest: "package.json" }, | ||
{ | ||
src: "README.md", | ||
transform: (content) => content.replace(/^---[^]*/m, READ_MORE), | ||
}, | ||
...fs | ||
.readdirSync(path.join(DIR, "bin")) | ||
.filter((file) => !file.startsWith(".") && file.endsWith(".js")) | ||
.map((file) => ({ src: path.join("bin", file) })), | ||
...fs | ||
.readdirSync(DIR) | ||
.filter((file) => !file.startsWith(".") && file.endsWith(".js")) | ||
.map((file) => ({ src: file })), | ||
]; | ||
|
||
if (fs.existsSync(BUILD)) { | ||
fs.rmdirSync(BUILD, { recursive: true }); | ||
} | ||
|
||
fs.mkdirSync(BUILD); | ||
|
||
for (const { src, dest = src, transform } of FILES_TO_COPY) { | ||
if (transform) { | ||
fs.writeFileSync( | ||
path.join(BUILD, dest), | ||
transform(fs.readFileSync(path.join(DIR, src), "utf8")) | ||
); | ||
} else { | ||
fs.mkdirSync(path.dirname(path.join(BUILD, dest)), { recursive: true }); | ||
fs.copyFileSync(path.join(DIR, src), path.join(BUILD, dest)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters