Skip to content

Commit

Permalink
fix: linting (#2479)
Browse files Browse the repository at this point in the history
* fix: linting

* chore: add changeset
  • Loading branch information
diegomura authored Jan 14, 2024
1 parent 8b00577 commit 45b2bd3
Show file tree
Hide file tree
Showing 32 changed files with 1,809 additions and 1,835 deletions.
10 changes: 10 additions & 0 deletions .changeset/gorgeous-dragons-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@react-pdf/examples': patch
'@react-pdf/textkit': patch
'@react-pdf/layout': patch
'@react-pdf/pdfkit': patch
'@react-pdf/image': patch
'@react-pdf/yoga': patch
---

fix linting
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules
lib
rollup.config.js
packages/yoga/dist
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = {
},
plugins: ['react', 'jest'],
rules: {
'func-names': 0,
'no-continue': 1,
'no-cond-assign': 1,
'react/prop-types': 0,
Expand All @@ -37,7 +38,7 @@ module.exports = {
'import/no-named-as-default': 0,
'react/state-in-constructor': 0,
'react/jsx-filename-extension': 0,
'react/jsx-props-no-spreading': 1,
'react/jsx-props-no-spreading': 0,
'react/destructuring-assignment': 0,
},
};
1 change: 0 additions & 1 deletion packages/examples/src/fractals/Fractal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { Text, View, StyleSheet } from '@react-pdf/renderer';

const palette = [
Expand Down
1 change: 0 additions & 1 deletion packages/examples/src/fractals/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { Page, Document } from '@react-pdf/renderer';

import Fractal from './Fractal';
Expand Down
4 changes: 0 additions & 4 deletions packages/examples/src/goTo/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/* eslint react/prop-types: 0, react/jsx-sort-props: 0 */

import React from 'react';

import { Page, Document, Link, View, Image } from '@react-pdf/renderer';

export default () => (
Expand Down
4 changes: 1 addition & 3 deletions packages/examples/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import './index.css';

import React, { useState } from 'react';
import { useState } from 'react';
import ReactDOM from 'react-dom';
import { PDFViewer } from '@react-pdf/renderer';

Expand Down
1 change: 0 additions & 1 deletion packages/examples/src/knobs/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { Document, Page, View, Text, StyleSheet } from '@react-pdf/renderer';

const styles = StyleSheet.create({
Expand Down
1 change: 0 additions & 1 deletion packages/examples/src/mediaQueries/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { Document, Page, View, StyleSheet } from '@react-pdf/renderer';

const styles = StyleSheet.create({
Expand Down
1 change: 0 additions & 1 deletion packages/examples/src/pageWrap/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {
Document,
Font,
Expand Down
1 change: 0 additions & 1 deletion packages/examples/src/resume/Education.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { Text, View, StyleSheet } from '@react-pdf/renderer';

import Title from './Title';
Expand Down
7 changes: 2 additions & 5 deletions packages/examples/src/resume/Experience.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable react/no-array-index-key */

import React from 'react';
import { Text, View, StyleSheet } from '@react-pdf/renderer';

import Title from './Title';
Expand Down Expand Up @@ -77,8 +74,8 @@ const ExperienceEntry = ({ company, details, position, date }) => {
</View>
</View>
<List>
{details.map((detail, i) => (
<Item key={i} style={styles.detailContainer}>
{details.map(detail => (
<Item key={detail.company} style={styles.detailContainer}>
{detail}
</Item>
))}
Expand Down
2 changes: 0 additions & 2 deletions packages/examples/src/resume/Header.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import { Link, Text, View, StyleSheet } from '@react-pdf/renderer';

const styles = StyleSheet.create({
Expand Down
1 change: 0 additions & 1 deletion packages/examples/src/resume/List.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { Text, View, StyleSheet } from '@react-pdf/renderer';

const styles = StyleSheet.create({
Expand Down
7 changes: 2 additions & 5 deletions packages/examples/src/resume/Skills.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable react/no-array-index-key */

import React from 'react';
import { Text, View, StyleSheet } from '@react-pdf/renderer';

import Title from './Title';
Expand All @@ -23,8 +20,8 @@ const SkillEntry = ({ name, skills }) => (
<View>
<Text style={styles.title}>{name}</Text>
<List>
{skills.map((skill, i) => (
<Item key={i}>{skill}</Item>
{skills.map(skill => (
<Item key={skill}>{skill}</Item>
))}
</List>
</View>
Expand Down
1 change: 0 additions & 1 deletion packages/examples/src/resume/Title.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { Text, StyleSheet } from '@react-pdf/renderer';

const styles = StyleSheet.create({
Expand Down
1 change: 0 additions & 1 deletion packages/examples/src/resume/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {
Text,
Font,
Expand Down
2 changes: 0 additions & 2 deletions packages/examples/src/svg/Heart.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import { Svg, G, Path } from '@react-pdf/renderer';

const Heart = () => (
Expand Down
1 change: 0 additions & 1 deletion packages/examples/src/svg/Svg1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { Rect, Svg, G, Path, Text, Tspan } from '@react-pdf/renderer';

const Svg1 = () => (
Expand Down
1 change: 0 additions & 1 deletion packages/examples/src/svg/Svg2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {
Rect,
Svg,
Expand Down
1 change: 0 additions & 1 deletion packages/examples/src/svg/Svg4.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {
Svg,
Stop,
Expand Down
1 change: 0 additions & 1 deletion packages/examples/src/svg/svg.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { Svg, G, Polygon } from '@react-pdf/renderer';

const Tiger = () => (
Expand Down
1 change: 0 additions & 1 deletion packages/examples/src/text/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable jsx-a11y/anchor-is-valid */

import React from 'react';
import {
Document,
Page,
Expand Down
2 changes: 1 addition & 1 deletion packages/image/src/png.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PNG from '@react-pdf/png-js';

PNG.isValid = function(data) {
PNG.isValid = function isValid(data) {
try {
return !!new PNG(data);
} catch (e) {
Expand Down
1 change: 1 addition & 0 deletions packages/layout/src/steps/resolvePagination.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-use-before-define */
/* eslint-disable no-continue */
/* eslint-disable prefer-destructuring */

Expand Down
3 changes: 3 additions & 0 deletions packages/pdfkit/src/font/afm.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* eslint-disable no-var */
/* eslint-disable no-cond-assign */

import fs from 'fs';
import range from '../utils/range';

Expand Down
6 changes: 4 additions & 2 deletions packages/pdfkit/src/font/embedded.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-cond-assign */
// eslint-disable-next-line no-unused-vars
import PDFObject from '../object';

const toHex = function(...codePoints) {
Expand Down Expand Up @@ -77,7 +79,7 @@ const createEmbeddedFont = PDFFont =>
let last = 0;
let index = 0;
while (index <= text.length) {
var needle;
let needle;
if (
(index === text.length && last < index) ||
((needle = text.charAt(index)), [' ', '\t'].includes(needle))
Expand Down Expand Up @@ -177,7 +179,7 @@ const createEmbeddedFont = PDFFont =>

// generate a random tag (6 uppercase letters. 65 is the char code for 'A')
const tag = [0, 1, 2, 3, 4, 5]
.map(i => String.fromCharCode(Math.random() * 26 + 65))
.map(() => String.fromCharCode(Math.random() * 26 + 65))
.join('');
const name = tag + '+' + this.font.postscriptName;

Expand Down
14 changes: 0 additions & 14 deletions packages/textkit/src/attributedString/copy.js

This file was deleted.

Loading

0 comments on commit 45b2bd3

Please sign in to comment.