Skip to content

Commit

Permalink
chore: update eslint-config-eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Jan 27, 2024
1 parent af43d39 commit 983d65e
Show file tree
Hide file tree
Showing 11 changed files with 828 additions and 149 deletions.
28 changes: 18 additions & 10 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ module.exports = eleventyConfig => {
throwOnUndefined: true
});

/** ***************************************************************************************
/**
* ***************************************************************************************
* Filters
* ***************************************************************************************/
* **************************************************************************************
*/
eleventyConfig.addFilter("limitTo", (arr, limit) => arr.slice(0, limit));

eleventyConfig.addFilter("jsonify", variable => JSON.stringify(variable));
Expand Down Expand Up @@ -133,9 +135,11 @@ module.exports = eleventyConfig => {

eleventyConfig.addFilter("concat", (value1, value2) => value1.concat(value2));

/** ***************************************************************************************
/**
* ***************************************************************************************
* Plugins
* ***************************************************************************************/
* **************************************************************************************
*/
eleventyConfig.addPlugin(eleventyNavigationPlugin);
eleventyConfig.addPlugin(readingTime);
eleventyConfig.addPlugin(syntaxHighlight, {
Expand Down Expand Up @@ -163,9 +167,11 @@ module.exports = eleventyConfig => {
eleventyConfig.addWatchTarget("./src/assets/");
eleventyConfig.addWatchTarget("./src/content/pages/");

/** ***************************************************************************************
/**
* ***************************************************************************************
* File PassThroughs
* ***************************************************************************************/
* **************************************************************************************
*/

eleventyConfig.addPassthroughCopy({
"./src/static": "/"
Expand Down Expand Up @@ -202,9 +208,11 @@ module.exports = eleventyConfig => {
});


/** ***************************************************************************************
/**
* ***************************************************************************************
* Collections
* ***************************************************************************************/
* **************************************************************************************
*/

eleventyConfig.addCollection(
"blogposts",
Expand Down Expand Up @@ -236,7 +244,7 @@ module.exports = eleventyConfig => {
formats: ["webp", "jpeg"],
urlPath: "/assets/images/",
outputDir: "./_site/assets/images/",
filenameFormat: (id, source, width, format) => {
filenameFormat(id, source, width, format) {
const extension = path.extname(source);
const name = path.basename(source, extension);

Expand All @@ -257,7 +265,7 @@ module.exports = eleventyConfig => {
const fullSrc = getSRC();

// generate images
Image(fullSrc, options); // eslint-disable-line new-cap
Image(fullSrc, options); // eslint-disable-line new-cap -- Third-party code

const imageAttributes = {
alt,
Expand Down
48 changes: 24 additions & 24 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
module.exports = {
extends: ["stylelint-config-standard-scss"],
rules: {
"alpha-value-notation": "number",
"at-rule-empty-line-before": null,
"color-function-notation": "legacy",
"color-hex-case": null,
"custom-property-empty-line-before": null,
"custom-property-pattern": null,
"declaration-block-no-duplicate-properties": [true, {
"ignore": ["consecutive-duplicates-with-different-values"]
}],
"declaration-block-no-redundant-longhand-properties": null,
"declaration-block-no-shorthand-property-overrides": null,
"hue-degree-notation": "number",
indentation: 4,
"max-line-length": null,
"no-descending-specificity": null,
"number-leading-zero": null,
"number-no-trailing-zeros": null,
"property-no-unknown": null,
"property-no-vendor-prefix": null,
"selector-class-pattern": null,
"value-keyword-case": null,
},
extends: ["stylelint-config-standard-scss"],
rules: {
"alpha-value-notation": "number",
"at-rule-empty-line-before": null,
"color-function-notation": "legacy",
"color-hex-case": null,
"custom-property-empty-line-before": null,
"custom-property-pattern": null,
"declaration-block-no-duplicate-properties": [true, {
ignore: ["consecutive-duplicates-with-different-values"]
}],
"declaration-block-no-redundant-longhand-properties": null,
"declaration-block-no-shorthand-property-overrides": null,
"hue-degree-notation": "number",
indentation: 4,
"max-line-length": null,
"no-descending-specificity": null,
"number-leading-zero": null,
"number-no-trailing-zeros": null,
"property-no-unknown": null,
"property-no-vendor-prefix": null,
"selector-class-pattern": null,
"value-keyword-case": null
}
};
43 changes: 25 additions & 18 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

const js = require("@eslint/js");
const { FlatCompat } = require("@eslint/eslintrc");
const eslintConfigESLintCJS = require("eslint-config-eslint/cjs");
const globals = require("globals");
const jsdoc = require("eslint-plugin-jsdoc");
const reactPlugin = require("eslint-plugin-react");
const reactRecommended = require("eslint-plugin-react/configs/recommended");
const jsxA11yPlugin = require("eslint-plugin-jsx-a11y");
Expand All @@ -22,14 +22,13 @@ module.exports = [
"_site/**",
"src/assets/js/**",
"src/_data/**",
"src/_11ty/**"
"src/_11ty/**",
".stylelintrc.js"
]
},
...eslintConfigESLintCJS,
{
files: ["**/*.js"],
plugins: {
jsdoc
},
languageOptions: {
globals: {
...globals.node
Expand All @@ -41,19 +40,19 @@ module.exports = [
// Disable eslint-plugin-node rules from eslint-config-eslint
"no-process-exit": "off",
"func-style": "off",
"node/no-deprecated-api": "off",
"node/no-extraneous-require": "off",
"node/no-missing-require": "off",
"node/no-unpublished-bin": "off",
"node/no-unpublished-require": "off",
"node/no-unsupported-features/es-builtins": "off",
"node/no-unsupported-features/es-syntax": "off",
"node/no-unsupported-features/node-builtins": "off",
"node/process-exit-as-throw": "off",
"node/shebang": "off",
"node/no-extraneous-import": "off",
"node/no-missing-import": "off",
"node/no-unpublished-import": "off",
"n/no-deprecated-api": "off",
"n/no-extraneous-require": "off",
"n/no-missing-require": "off",
"n/no-unpublished-bin": "off",
"n/no-unpublished-require": "off",
"n/no-unsupported-features/es-builtins": "off",
"n/no-unsupported-features/es-syntax": "off",
"n/no-unsupported-features/node-builtins": "off",
"n/process-exit-as-throw": "off",
"n/shebang": "off",
"n/no-extraneous-import": "off",
"n/no-missing-import": "off",
"n/no-unpublished-import": "off",

// Disable rules that the codebase doesn't currently follow.
"jsdoc/require-jsdoc": "off",
Expand All @@ -62,6 +61,13 @@ module.exports = [
"jsdoc/require-param-type": "off"
}
},
{
files: ["tools/**/*.js"],
rules: {
"no-console": "off",
"n/no-process-exit": "off"
}
},
{
files: ["src/playground/**/*.{js,jsx}"],
plugins: {
Expand All @@ -80,6 +86,7 @@ module.exports = [
jsx: true
}
},
sourceType: "module",
globals: {
...globals.browser,
...globals.es2021
Expand Down
Loading

0 comments on commit 983d65e

Please sign in to comment.