Content-Length: 684389 | pFad | http://github.com/eslint/eslint/pull/19354/files

9B chore: enabled Prettier in Trunk by JoshuaKGoldberg · Pull Request #19354 · eslint/eslint · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enabled Prettier in Trunk #19354

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
default: true
extends: markdownlint/style/prettier

# Exclusions for deliberate/widespread violations
MD002: false # First header should be a h1 header
MD004: # Unordered list style
style: asterisk
MD007: # Unordered list indentation
indent: 4
MD013: false # Line length
MD019: false # Multiple spaces after hash on atx style header
MD021: false # Multiple spaces inside hashes on closed atx style header
MD024: false # Multiple headers with the same content
MD026: false # Trailing punctuation in header
MD029: false # Ordered list item prefix
MD030: false # Spaces after list markers
MD033: false # Allow inline HTML
MD041: false # First line in file should be a top level header
MD046: # Code block style
Expand Down
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"trailingComma": "none"
}
8 changes: 5 additions & 3 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@ lint:
- yamllint
- trufflehog # Requires the network to run.
ignore:
- linters: [markdownlint]
- linters: [markdownlint, prettier]
paths:
- CHANGELOG.md
- linters: [prettier]
paths:
- "**" # Ignore all files
- "!conf/**/*.json" # Except for json files in conf/
- docs/src/_includes
- docs/src/rules/*.md
- packages/js/src/configs/eslint-all.js
- tests/fixtures
actions:
disabled:
- trunk-announce
Expand Down
18 changes: 14 additions & 4 deletions docs/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["stylelint-config-standard-scss"],
"extends": ["stylelint-config-standard-scss", "stylelint-config-prettier"],
"rules": {
"alpha-value-notation": "number",
"at-rule-empty-line-before": null,
Expand All @@ -11,8 +11,6 @@
}],
"declaration-block-no-redundant-longhand-properties": null,
"hue-degree-notation": "number",
"indentation": 4,
"max-line-length": null,
"no-descending-specificity": null,
"number-leading-zero": null,
"number-no-trailing-zeros": null,
Expand All @@ -24,7 +22,19 @@
"files": [
"**/*.html"
],
"extends": ["stylelint-config-html/html", "stylelint-config-standard"]
"extends": [
"stylelint-config-html/html",
"stylelint-config-standard",
"stylelint-config-prettier"
]
},
{
"files": [
"**/*.scss"
],
"rules": {
"scss/operator-no-newline-after": null
}
}
],
"ignoreFiles": [
Expand Down
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"stylelint": "^14.13.0",
"stylelint-config-html": "^1.1.0",
"stylelint-config-standard": "^29.0.0",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-standard-scss": "^5.0.0",
"tap-spot": "^1.1.2"
},
Expand Down
9 changes: 2 additions & 7 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const eslintPluginRulesRecommendedConfig = require("eslint-plugin-eslint-plugin/
const eslintPluginTestsRecommendedConfig = require("eslint-plugin-eslint-plugin/configs/tests-recommended");
const globals = require("globals");
const eslintConfigESLintCJS = require("eslint-config-eslint/cjs");
const eslintConfigESLintFormatting = require("eslint-config-eslint/formatting");
const eslintPluginYml = require("eslint-plugin-yml");
const json = require("@eslint/json").default;
const expectType = require("eslint-plugin-expect-type");
Expand Down Expand Up @@ -79,11 +78,6 @@ module.exports = [
name: `eslint/${config.name}`,
files: [ALL_JS_FILES]
})),
{
...eslintConfigESLintFormatting,
name: "eslint/formatting",
files: [ALL_JS_FILES]
},
{
name: "eslint/global-ignores",
ignores: [
Expand Down Expand Up @@ -163,7 +157,8 @@ module.exports = [
"errors"
]
],
"eslint-plugin/test-case-shorthand-strings": "error"
"eslint-plugin/test-case-shorthand-strings": "error",
"no-useless-concat": "off"
}
},
{
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.js": "trunk check --fix --filter=eslint",
"*.md": "trunk check --fix --filter=markdownlint",
"*": "trunk check --fix",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means every single file type will be run through Trunk, and I'm not sure we want that at this point.

Let's go slow and just stick with JS and Markdown. We can explore other file types later.

"lib/rules/*.js": [
"node tools/update-eslint-all.js",
"node tools/update-rule-type-headers.js",
Expand All @@ -83,8 +82,7 @@
"node tools/check-rule-examples.js",
"node tools/fetch-docs-links.js",
"git add docs/src/_data/further_reading_links.json"
],
"docs/**/*.svg": "trunk check --fix --filter=svgo"
]
},
"files": [
"LICENSE",
Expand Down
2 changes: 0 additions & 2 deletions packages/js/src/configs/eslint-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
*/
"use strict";

/* eslint quote-props: off -- autogenerated so don't lint */

/*
* IMPORTANT!
*
Expand Down
9 changes: 0 additions & 9 deletions tests/lib/rules/utils/ast-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,6 @@ describe("ast-utils", () => {
});

describe("getStaticStringValue", () => {

/* eslint-disable quote-props -- Make consistent here for readability */
const expectedResults = {

// string literals
Expand Down Expand Up @@ -516,7 +514,6 @@ describe("ast-utils", () => {
"this": null,
"(function () {})": null
};
/* eslint-enable quote-props -- Make consistent here for readability */

Object.keys(expectedResults).forEach(key => {
it(`should return ${expectedResults[key]} for ${key}`, () => {
Expand Down Expand Up @@ -1070,8 +1067,6 @@ describe("ast-utils", () => {
});

describe("getNextLocation", () => {

/* eslint-disable quote-props -- Make consistent here for readability */
const expectedResults = {
"": [[1, 0], null],
"\n": [[1, 0], [2, 0], null],
Expand All @@ -1093,7 +1088,6 @@ describe("ast-utils", () => {
"a\t": [[1, 0], [1, 1], [1, 2], null],
"a \n": [[1, 0], [1, 1], [1, 2], [2, 0], null]
};
/* eslint-enable quote-props -- Make consistent here for readability */

Object.keys(expectedResults).forEach(code => {
it(`should return expected locations for "${code}".`, () => {
Expand Down Expand Up @@ -1721,8 +1715,6 @@ describe("ast-utils", () => {
});

describe("hasOctalOrNonOctalDecimalEscapeSequence", () => {

/* eslint-disable quote-props -- Make consistent here for readability */
const expectedResults = {
"\\1": true,
"\\2": true,
Expand Down Expand Up @@ -1794,7 +1786,6 @@ describe("ast-utils", () => {
"foo\\\nbar": false,
"128\\\n349": false
};
/* eslint-enable quote-props -- Make consistent here for readability */

Object.keys(expectedResults).forEach(key => {
it(`should return ${expectedResults[key]} for ${key}`, () => {
Expand Down
2 changes: 0 additions & 2 deletions tests/lib/shared/string-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ describe("upperCaseFirst", () => {
});

describe("getGraphemeCount", () => {
/* eslint-disable quote-props -- Make consistent here for readability */
const expectedResults = {
"": 0,
"a": 1,
Expand All @@ -79,7 +78,6 @@ describe("getGraphemeCount", () => {
"👶🏽👨‍👩‍👦": 2,
"👩‍🦰👩‍👩‍👦‍👦🏳️‍🌈": 3 // 3 grapheme, 14 code points, 22 code units
};
/* eslint-enable quote-props -- Make consistent here for readability */

Object.entries(expectedResults).forEach(([key, value]) => {
it(`should return ${value} for ${escapeControlCharacters(key)}`, () => {
Expand Down
2 changes: 0 additions & 2 deletions tools/update-eslint-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ const code = `/*
*/
"use strict";

/* eslint quote-props: off -- autogenerated so don't lint */

/*
* IMPORTANT!
*
Expand Down
2 changes: 0 additions & 2 deletions tools/update-readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ async function fetchTeamData() {
* @returns {string} The HTML for the members list.
*/
function formatTeamMembers(members) {
/* eslint-disable indent -- Allow deeper template substitution indent */
return stripIndents`
<table><tbody><tr>${members
.map(
Expand All @@ -70,7 +69,6 @@ function formatTeamMembers(members) {
</td>${(index + 1) % 9 === 0 ? "</tr><tr>" : ""}`
)
.join("")}</tr></tbody></table>`;
/* eslint-enable indent -- Allow deeper template substitution indent */
}

//-----------------------------------------------------------------------------
Expand Down
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/eslint/eslint/pull/19354/files

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy